Re: issue with double ordering in a wrapped distinct
| От | Tom Lane |
|---|---|
| Тема | Re: issue with double ordering in a wrapped distinct |
| Дата | |
| Msg-id | 25752.1416354194@sss.pgh.pa.us обсуждение исходный текст |
| Ответ на | issue with double ordering in a wrapped distinct (Jonathan Vanasco <postgres@2xlp.com>) |
| Ответы |
Re: issue with double ordering in a wrapped distinct
|
| Список | pgsql-general |
Jonathan Vanasco <postgres@2xlp.com> writes: > This is what I don't understand -- notice the two order_by calls. > If i run this with an inner and outer order_by, I get ~305ms. (I don't think I need both, but I wasn't sure if orderingis kept from a subselect ) > If i run this with only the inner, I get ~304ms. > If I run this with only the outer, it's pushing over 10minutes again > i'm wondering if anyone might know why that performance hit would be happening The inner ORDER BY would prevent the planner from flattening the two query levels into one; but as for why it gets a much worse plan after flattening --- insufficient data. https://wiki.postgresql.org/wiki/Slow_Query_Questions regards, tom lane
В списке pgsql-general по дате отправления: