Обсуждение: COUNT

Поиск
Список
Период
Сортировка

COUNT

От
"Lufkin, Brad"
Дата:
I'm trying to determine the number of rows in a table with the following
statement:

    ResultSet resultSet = statement.executeQuery("SELECT COUNT(*) FROM
table");

This is apparently causing a sequential scan of the table (which has several
million rows). Is there a faster way of  determining the number of rows in a
table?