Re: WHERE IN (subselect) versus WHERE IN (1,2,3,)

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: WHERE IN (subselect) versus WHERE IN (1,2,3,)
Дата
Msg-id 25285.1332167318@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: WHERE IN (subselect) versus WHERE IN (1,2,3,)  (Kevin Goess <kgoess@bepress.com>)
Ответы Re: WHERE IN (subselect) versus WHERE IN (1,2,3,)  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general
Kevin Goess <kgoess@bepress.com> writes:
> On Mon, Mar 19, 2012 at 9:24 AM, Albe Laurenz <laurenz.albe@wien.gv.at>wrote:
>> That means that your statistics are not accurate.

> Aha, thanks, that explains why my test table with one row was so bad.  But
> even with all freshly ANALYZE'd tables, I still see the query reverting to
> a sequential scan on that big contexts table once the number of rows in the
> subselect goes over 199.  Here's a simplified version that demonstrates the
> problem.

You've still got a nasty join-size estimation error:

>          ->  Nested Loop  (cost=6.18..1939.43 rows=411736 width=8) (actual
> time=0.203..3.487 rows=35 loops=1)

It's not apparent why that's so far off ...

            regards, tom lane

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

Предыдущее
От: Bill Moran
Дата:
Сообщение: Re: Anonymized database dumps
Следующее
От: Janning Vygen
Дата:
Сообщение: Re: Anonymized database dumps