Re: planner question..

Поиск
Список
Период
Сортировка
От Stephan Szabo
Тема Re: planner question..
Дата
Msg-id 20030417064926.C87131-100000@megazone23.bigpanda.com
обсуждение исходный текст
Ответ на planner question..  (Rajesh Kumar Mallah <mallah@trade-india.com>)
Ответы Re: planner question..  (Rajesh Kumar Mallah <mallah@trade-india.com>)
Список pgsql-sql
On Thu, 17 Apr 2003, Rajesh Kumar Mallah wrote:

> For a distribution of data like below why does the planner
> choses to do an index scan by default for source = 'REGIS' when > 50%
> of the rows are having source='REGIS'.

It's not estimating that though.

> tradein_clients=# SET enable_indexscan=off;
> tradein_clients=# explain analyze SELECT count(*) from  profile_master where source='REGIS';
>
+------------------------------------------------------------------------------------------------------------------------------+
> |                                                          QUERY PLAN
        |
 
>
+------------------------------------------------------------------------------------------------------------------------------+
> | Aggregate  (cost=23982.58..23982.58 rows=1 width=0) (actual time=22872.97..22872.97 rows=1 loops=1)
        |
 
> |   ->  Seq Scan on profile_master  (cost=0.00..23970.40 rows=4871 width=0) (actual time=328.44..22730.69 rows=102090
loops=1)|
 

It's expecting that about 5000 rows match not 100000.

Does it get better if you raise the statistics target for the
column (see ALTER TABLE) from 10 to say 50 or 100?



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

Предыдущее
От: Rajesh Kumar Mallah
Дата:
Сообщение: Re: getting rid of "Adding missing FROM-clause entry...."
Следующее
От: Rajesh Kumar Mallah
Дата:
Сообщение: Re: planner question..