Re: Postgres 8.4 planner question - bad plan, good plan for almost same queries.

Поиск
Список
Период
Сортировка
От Дмитрий
Тема Re: Postgres 8.4 planner question - bad plan, good plan for almost same queries.
Дата
Msg-id 4F69B08E.8040407@ac-sw.com
обсуждение исходный текст
Ответ на Re: Postgres 8.4 planner question - bad plan, good plan for almost same queries.  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
> I think the reason the planner isn't too bright about this case is
> http://git.postgresql.org/gitweb/?p=postgresql.git&a=commitdiff&h=cd1f0d04bf06938c0ee5728fc8424d62bcf2eef3
> ie, it won't do IN/EXISTS pullup below a NOT EXISTS.
>
> HEAD is better, thanks to commit
> 0816fad6eebddb8f1f0e21635e46625815d690b9, but of course there is no
> chance at all of back-patching the planner changes that depends on.

I found that it works fine for [NOT] EXISTS if I just fold query inside 
into "select 1 from (...) vv". With my provided query, it uses seqscan 
for both EXISTS/NOT EXISTS without folding, and index scan with it.

Okay, it's easier for me to make automatic subquery folding.

Regards,
Dmitry


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

Предыдущее
От: Kohei KaiGai
Дата:
Сообщение: Re: [v9.2] Add GUC sepgsql.client_label
Следующее
От: Fujii Masao
Дата:
Сообщение: Re: Scaling XLog insertion (was Re: Moving more work outside WALInsertLock)