Re: 7.1.3 not using index

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: 7.1.3 not using index
Дата
Msg-id 14769.1007400883@sss.pgh.pa.us
обсуждение исходный текст
Ответ на 7.1.3 not using index  (Daniel Kalchev <daniel@digsys.bg>)
Ответы Re: 7.1.3 not using index  (Daniel Kalchev <daniel@digsys.bg>)
Список pgsql-hackers
Daniel Kalchev <daniel@digsys.bg> writes:
> (table has ~30k rows)
> EXPLAIN SELECT * FROM r where d = 8;
> The result is 
> NOTICE: QUERY PLAN:
> Seq Scan on r (cost=0.00...3041.13 rows=7191 width=4)

Seqscan is the right plan to retrieve 7k rows out of a 30k table.
So the question is whether that estimate is in the right ballpark
or not.  How many rows are there really with d=8?  If it's way off,
what do you get from

select attname,attdispersion,s.*
from pg_statistic s, pg_attribute a, pg_class c
where starelid = c.oid and attrelid = c.oid and staattnum = attnum
and relname = 'r';
        regards, tom lane


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

Предыдущее
От: Thomas Lockhart
Дата:
Сообщение: Re: Second call for platform testing
Следующее
От: brett_schwarz@yahoo.com (Brett Schwarz)
Дата:
Сообщение: OSDL