2 Commits

Author SHA1 Message Date
Matvey Arye
543a75f865 Refactor regression tests
This commit moves a lot of test setup logic to runner.sh. Also
passes the right commands to the regression infrastructure to create
appropriate users and run tests as a regular user.
2017-10-05 15:56:33 -04:00
Erik Nordström
139fe34022 Implement constraint-aware appends to exclude chunks at execution time
With standard PostgreSQL append plans, planning-time constraint
exclusion does not work if a query expression contains restrictions
that are non-constants (e.g., mutable functions like now()). This
leads to full scans of all chunks (child tables), significantly
increasing query time.

To fix this, we wrap append plans (Append and MergeAppend) in a
ConstraintAwareAppend plan, which excludes child relations at
execution time by pruning the child relations from the regular append
plan. This happens after first constifying the original restriction
clause every time the plan is executed.

This optimization only happens if there are non-constant restrictions
in the original query and the entire optimization can be disbled with
a GUC variable.
2017-08-19 10:51:10 +02:00