Draft LIMIT pushdown to Append and MergeAppend patch - Mailing list pgsql-hackers

From Michał Kłeczek
Subject Draft LIMIT pushdown to Append and MergeAppend patch
Date
Msg-id B629FDD4-78CE-45BE-A1C6-30E8B233FA3C@kleczek.org
Whole thread Raw
Responses Re: Draft LIMIT pushdown to Append and MergeAppend patch
List pgsql-hackers
Hi All,

Attached is a draft patch implementing LIMIT pushdown to Append and MergeAppend nodes.

This patch eliminates the need to resort to subqueries to optimise UNIONs.
It also enables more aggressive partition pruning.
Not sure if it causes LIMIT pushdown to foreign partitions though.

Applying this patch causes regressions in:
- postgres_fdw tests
- partitions tests

This is due to subsequent partition pruning applied when LIMIT is pushed down - I guess that’s a (big) win.

I would be happy to hear if the approach is sound.

Thanks,
Michal
Attachment

pgsql-hackers by date:

Previous
From: Richard Guo
Date:
Subject: Check each of base restriction clauses for constant-FALSE-or-NULL
Next
From: Richard Guo
Date:
Subject: Re: Wrong results with grouping sets