Re: issue with double ordering in a wrapped distinct

Поиск
Список
Период
Сортировка
От Jonathan Vanasco
Тема Re: issue with double ordering in a wrapped distinct
Дата
Msg-id FED649BB-5588-4EC2-BC23-B7E97F2DBC65@2xlp.com
обсуждение исходный текст
Ответ на Re: issue with double ordering in a wrapped distinct  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: issue with double ordering in a wrapped distinct  (Jonathan Vanasco <postgres@2xlp.com>)
Список pgsql-general

On Nov 18, 2014, at 6:43 PM, Tom Lane wrote:
but as for why it gets a much worse plan after
flattening --- insufficient data.

Thanks.  I'll run some test cases in the morning and post the full queries matched with ANALYZE EXPLAIN.  
This is just puzzling to me.  I was hoping there might be a more general planner issue that someone would have noticed.


On Nov 18, 2014, at 6:55 PM, David G Johnston wrote:

I presume you have a reason for not simply doing away with the subquery
altogether...

When not using the subquery, the query ran in 1s -- if I didn't have a LIMIT/OFFSET
Adding a LIMIT/OFFSET to that query made it run for nearly 6 minutes.
The only way I could manage to trick it to use the better query plan, was to wrap the "good" query as a subquery, and then run a LIMIT/OFFSET in the outer query.

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

Предыдущее
От: "Joshua D. Drake"
Дата:
Сообщение: Linuxfest 2015 Call for Papers
Следующее
От: Yanrui Hu
Дата:
Сообщение: Re: About the tps explanation of pgbench, please help