Re: Creating Index

Поиск
Список
Период
Сортировка
От Peter Eisentraut
Тема Re: Creating Index
Дата
Msg-id Pine.LNX.4.44.0310011419060.2932-100000@peter.localdomain
обсуждение исходный текст
Ответ на Creating Index  ("CN" <cnliou9@fastmail.fm>)
Ответы Re: Creating Index  ("CN" <cnliou9@fastmail.fm>)
Список pgsql-sql
CN writes:

> Table1 contains 9000 rows and table2 contains 0 row. This query, which
> takes 13489 msec, is extremely slow as pgsql sequentially scans all rows
> in table1:
>
> EXPLAIN ANALYZE SELECT COUNT(*) FROM view1;

Unqualified count() cannot use an index because it has to visit all the
rows in the table.  Then again, I don't quite believe that visiting 9000
rows takes 13 seconds.  Can you show us the result of EXPLAIN ANALYZE and
your real table and view definitions, because the ones you showed
contained a few syntax errors.

-- 
Peter Eisentraut   peter_e@gmx.net



В списке pgsql-sql по дате отправления:

Предыдущее
От: "CN"
Дата:
Сообщение: Creating Index
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Determining Inheritance