> I think that in cases where there's not a semantic hazard involved,
> we'd usually have pulled up the subquery so that this is all moot
> anyway.
>
I get your point with this statement. Things driven by this idea look
practical and lucky. But for the UniqueKey stuff, we are not
that lucky.
SEL
Andy Fan writes:
> On Sat, Jul 24, 2021 at 10:14 PM Tom Lane wrote:
>> Why do you "expect" that? I think pushing the outer ORDER BY past a
>> LIMIT is an unacceptable semantics change.
> I don't mean push down a "ORDER BY" clause to subquery, I mean push
> down an "interesting order" to subque
On Sat, Jul 24, 2021 at 10:14 PM Tom Lane wrote:
>
> Andy Fan writes:
> > When I am working on the UnqiueKey stuff, I find the following cases.
> > SELECT * FROM (SELECT * FROM t offset 0) v ORDER BY a;
> > // root->query_keys = A. root->order_pathkeys = A
> > // Current: subroot->query_pathkeys
Andy Fan writes:
> When I am working on the UnqiueKey stuff, I find the following cases.
> SELECT * FROM (SELECT * FROM t offset 0) v ORDER BY a;
> // root->query_keys = A. root->order_pathkeys = A
> // Current: subroot->query_pathkeys = NIL.
> // Expected: subroot->_pathkeys = [A].
Why do