Re: again on index usage (7.1.3)

Поиск
Список
Период
Сортировка
От Stephan Szabo
Тема Re: again on index usage (7.1.3)
Дата
Msg-id 20020212083800.A93221-100000@megazone23.bigpanda.com
обсуждение исходный текст
Ответ на Re: again on index usage (7.1.3)  (Daniel Kalchev <daniel@digsys.bg>)
Список pgsql-hackers
On Tue, 12 Feb 2002, Daniel Kalchev wrote:

> >>>Stephan Szabo said:
>  >
>  > Let's start with the standard set of things.  Have you vacuum analyzed,
>  > what does explain show for the query, is there one value that is more
>  > common than all others?
>  >
>
> My most recent 'standard' answer these days is "it worked well before VACUUM
> ANALYZE" :-)

Do you have a single value that is much more common than the rest (say
approximately 170000 of the rows?)  It's estimating almost 18000 matching
rows, but I'm guessing that that's not a reasonable estimate.

>
> RADIUS=# explain
> select * from attrib where user_name = 'Paacons'RADIUS-# ;
> NOTICE:  QUERY PLAN:
>
> Seq Scan on attrib  (cost=0.00..16978.46 rows=17922 width=48)
>
> EXPLAIN
>
> is what explain says by default.
>
> RADIUS=# set enable_seqscan='off';
> SET VARIABLE
>
> RADIUS=# explain
> select * from attrib where user_name = 'Paacons';
> NOTICE:  QUERY PLAN:
>
> Index Scan using uattr on attrib  (cost=0.00..32861.00 rows=17922 width=48)
>
> EXPLAIN
>
> Daniel
>



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

Предыдущее
От: Daniel Kalchev
Дата:
Сообщение: Re: again on index usage (7.1.3)
Следующее
От: "Hiroshi Inoue"
Дата:
Сообщение: Re: alter table drop column status