Query planner isn't using my indices

Поиск
Список
Период
Сортировка
От Alaric B. Snell
Тема Query planner isn't using my indices
Дата
Msg-id Pine.LNX.4.43.0201082106100.311-100000@calvin.frontwire.com
обсуждение исходный текст
Ответы Re: Query planner isn't using my indices  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: Query planner isn't using my indices  (Stephan Szabo <sszabo@megazone23.bigpanda.com>)
Re: Query planner isn't using my indices  (Jason Earl <jason.earl@simplot.com>)
Список pgsql-general
To cut a long story short, my largish development database was running the
query I was tinkering with very slowly.

Looking a little deeper, I found that it was always doing a full table
scan.

Which is odd, seeing as we're selecting on a uniquely indexed field...

frontwire=# \d stakeholder_pk
Index "stakeholder_pk"
 Attribute |  Type
-----------+--------
 id        | bigint
unique btree

frontwire=# explain select * from stakeholder where id = 1;
NOTICE:  QUERY PLAN:

Seq Scan on stakeholder  (cost=0.00..602.81 rows=1 width=336)

EXPLAIN
frontwire=# select count(*) from stakeholder;
 count
-------
  9170
(1 row)

...why is this happening? It... shouldn't!

ABS

--
Alaric B. Snell, Developer
abs@frontwire.com


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

Предыдущее
От: "Jeffrey W. Baker"
Дата:
Сообщение: Re: sequential scans and the like operator
Следующее
От: Tom Lane
Дата:
Сообщение: Re: sequential scans and the like operator