Gregory Stark wrote:
Ideally we would also be able to do this in the planner. If the planner could
determine from the constraints that all the key values from each partition are
non-overlapping and order them properly then it could generate a regular
append node with a path order without the overhead of the run-time
comparisons.

But that requires a) dealing with the problem of the parent table which has no
constraints and ...

It would help even if you could only prove it for some partitions. You could use a regular append node for the partitions you know not to overlap, and merge the output of that with the new kind of ordered append node. We'd see that the parent table is empty on the first invocation, and after that the ordered append node would just pass through the tuples.

--
  Heikki Linnakangas
  EnterpriseDB   http://www.enterprisedb.com

---------------------------(end of broadcast)---------------------------
TIP 7: You can help support the PostgreSQL project by donating at

               http://www.postgresql.org/about/donate

Reply via email to