Re: different query plan because different limit # (Re: weird query plan)

Поиск
Список
Период
Сортировка
От Gregory Stark
Тема Re: different query plan because different limit # (Re: weird query plan)
Дата
Msg-id 87ejkph1zc.fsf@oxford.xeocode.com
обсуждение исходный текст
Ответ на different query plan because different limit # (Re: weird query plan)  (weiping <laserlist@pgsqldb.com>)
Список pgsql-performance
"weiping" <laserlist@pgsqldb.com> writes:

> -> Index Scan using urlusermaps_userid on wd_urlusermaps
>    (cost=0.00..6750.55 rows=1094 width=4) (actual time=1.478..16.563 rows=41 loops=1)
>    Index Cond: (userid = 219177)
>    Filter: ("share" = 1)

It's estimating 1094 rows and getting 41 rows. You might considering raising
the statistics target for that table.

Does it get accurate estimates for the number of rows for each of these?

explain analyze select * from wd_urlusermaps where userid=219177
explain analyze select * from wd_urlusermaps where share=1

(the latter might take a while)

--
  Gregory Stark
  EnterpriseDB          http://www.enterprisedb.com


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

Предыдущее
От: weiping
Дата:
Сообщение: Re: different query plan because different limit # (Re: weird query plan)
Следующее
От: Douglas J Hunley
Дата:
Сообщение: Re: upgraded to pgsql 8.2.4, getting worse performance then 7.4.x