Re: pgsql: Fix LATERAL join test in test memoize.sql
От | Tom Lane |
---|---|
Тема | Re: pgsql: Fix LATERAL join test in test memoize.sql |
Дата | |
Msg-id | 2149153.1674519788@sss.pgh.pa.us обсуждение исходный текст |
Ответ на | Re: pgsql: Fix LATERAL join test in test memoize.sql (David Rowley <dgrowleyml@gmail.com>) |
Список | pgsql-committers |
David Rowley <dgrowleyml@gmail.com> writes: > You're right that OFFSET 0 would have been a better choice. I just > wasn't aware that we were considering changing the code so we pull up > subqueries with an ORDER BY. No such plan is in the offing AFAIK, but it doesn't seem entirely out of the question either. > In fact, I thought there were several > good reasons we're not doing that. e.g. allow aggregation in outer > query by some order specified by the subquery. But perhaps any changes > we make in this area would be more conditional than just ignoring the > fact that the subquery has an ORDER BY. Yeah, we've historically honored subquery ORDER BY and I doubt we'd want to stop. But I'm not sure that that that completely precludes subquery flattening, especially for single-relation subqueries such as these. You could imagine, for example, still doing the pull-up and then only accepting paths for the rel that satisfy the ORDER BY. This could still lead to better optimization of the outer query than what happens now, I think. Anyway, it's not something I expect to happen soon, but maybe someday. regards, tom lane
В списке pgsql-committers по дате отправления: