Re: Seq Scan

Поиск
Список
Период
Сортировка
От Joshua D. Drake
Тема Re: Seq Scan
Дата
Msg-id 46605131.8060101@commandprompt.com
обсуждение исходный текст
Ответ на Seq Scan  ("Tyler Durden" <tylersticky@gmail.com>)
Ответы Re: Seq Scan  ("Tyler Durden" <tylersticky@gmail.com>)
Список pgsql-general
Tyler Durden wrote:
> Hi,
> I'm having some problems in performance in a simple select count(id)
> from.... I have 700 000 records in one table, and when I do:
>
> # explain select (id) from table_name;
> -[ RECORD 1
> ]----------------------------------------------------------------
> QUERY PLAN | Seq Scan on table_name  (cost=0.00..8601.30 rows=266730
> width=4)
>
> I had created an index for id(btree), but still shows "Seq Scan".
> What I'm doing wrong?

Nothing. You have to scan the table because you aren't giving postgresql
anything to use the index by.

Joshua D. Drake

>
> Thanks,
> Tyler
>
> ---------------------------(end of broadcast)---------------------------
> TIP 6: explain analyze is your friend
>


--

       === The PostgreSQL Company: Command Prompt, Inc. ===
Sales/Support: +1.503.667.4564 || 24x7/Emergency: +1.800.492.2240
Providing the most comprehensive  PostgreSQL solutions since 1997
              http://www.commandprompt.com/

Donate to the PostgreSQL Project: http://www.postgresql.org/about/donate
PostgreSQL Replication: http://www.commandprompt.com/products/


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

Предыдущее
От: "John D. Burger"
Дата:
Сообщение: Re: Seq Scan
Следующее
От: "Simon Riggs"
Дата:
Сообщение: Re: warm standby server stops doingcheckpointsafterawhile