-
Notifications
You must be signed in to change notification settings - Fork 882
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove hypertable parent from query plans #1007
Conversation
-> Seq Scan on _hyper_1_1_chunk | ||
(5 rows) | ||
QUERY PLAN | ||
------------------------------------------------------------------------------------- |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This plan seems very odd. Why do we have a merge append for only one child
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
well that can happen cause postgres doesnt know before how many children it will end up with
Codecov Report
@@ Coverage Diff @@
## master #1007 +/- ##
=========================================
Coverage ? 90.88%
=========================================
Files ? 89
Lines ? 10258
Branches ? 0
=========================================
Hits ? 9323
Misses ? 935
Partials ? 0
Continue to review full report at Codecov.
|
Codecov Report
@@ Coverage Diff @@
## master #1007 +/- ##
=========================================
- Coverage 91.87% 91.78% -0.1%
=========================================
Files 91 91
Lines 10806 10793 -13
=========================================
- Hits 9928 9906 -22
- Misses 878 887 +9
Continue to review full report at Codecov.
|
9db0d30
to
c26933e
Compare
test/expected/rowsecurity-11.out
Outdated
-> Seq Scan on t1 | ||
Filter: ((a % 2) = 0) | ||
(3 rows) | ||
QUERY PLAN |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we probably do want to add some data to this table so that we can see the filter correctly applied. Right now these test no longer test anything.
test/expected/rowsecurity-11.out
Outdated
-----------+---------+--------- | ||
(0 rows) | ||
|
||
ERROR: cursor "current_check_cursor" is not a simply updatable scan of table "current_check" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These look bad. Why the change?
39e17bb
to
f453c63
Compare
92c073b
to
cc87060
Compare
Since the parent table of a hypertable cannot contain any rows including it in the plan is not necessary. PostgreSQL might also not have good statistics for the main table as autoanalyze is triggered by inserts which never happen to the main table, leading to worse plans. This patch adds a new guc enable_constraint_exclusion to disable planner constraint exclusion. Constraint exclusion will not work with cursors and WHERE CURRENT OF so the new guc will allow you to disable that feature. This patch also fixes constraint exclusion for JOINs and sort optimization for queries with chunks_in.
Since the parent table of a hypertable cannot contain
any rows including it in the plan is not necessary. PostgreSQL might
also not have good statistics for the main table as autoanalyze is
triggered by inserts which never happen to the main table, leading to
worse plans.
This patch adds a new guc enable_constraint_exclusion to disable
planner constraint exclusion. Constraint exclusion will not work with
cursors and WHERE CURRENT OF so the new guc will allow you to disable
that feature.
This patch also fixes constraint exclusion for JOINs and sort
optimization for queries with chunks_in.