Re: Ordered Partitioned Table Scans
Julien Rouhaud <rjuju123@gmail.com>
From: Julien Rouhaud <rjuju123@gmail.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: David Rowley <david.rowley@2ndquadrant.com>,
Antonin Houska <ah@cybertec.at>, Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2019-03-08T21:20:39Z
Lists: pgsql-hackers
On Fri, Mar 8, 2019 at 9:15 PM Tom Lane <tgl@sss.pgh.pa.us> wrote: > > David Rowley <david.rowley@2ndquadrant.com> writes: > > [ v9-0001-Allow-Append-to-be-used-in-place-of-MergeAppend-f.patch ] > > I think you should remove all that > and restrict this optimization to the case where all the subpaths are > natively ordered --- if we have to insert Sorts, it's hardly going to move > the needle to worry about simplifying the parent MergeAppend to Append. This can be a huge win for queries of the form "ORDER BY partkey LIMIT x". Even if the first subpath(s) aren't natively ordered, not all of the sorts should actually be performed.
Commits
-
Use Append rather than MergeAppend for scanning ordered partitions.
- 959d00e9dbe4 12.0 landed