-
Notifications
You must be signed in to change notification settings - Fork 136
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
Fix writable rules on table has relative matview. #584
Conversation
we can add additional checks inside Something like
This way we will never get fooled by executor/gp_matview_aux related bugs. |
make sense. |
Also think about triggers besides rules, though distributed triggers are not well supported in GPDB. |
I came up with another suggestion which worth a discussion. I propose to change this matview tracking algorithm from executor-based approach to TAM based one. That is, when relation data is modified (table_tuple_insert TAM method and similar), we mark all M.V. that depend on modified relation as stale(using gp_matview_tables). This does not covers table inheritance cases though. So, table ihn related check should remain in place. |
That's the my first drat approach, but it's more hard in MPP. The worse thing is, we use same kernel codes with CBDB in enterprise version using totally different AMs and different executors. If it's implemented in executor, other open source like Apache Arrow codes also need changed. And the last, remember it's used for AQUMV, we don't have customers want to use inherits table to answer query. Even though all that could be done well, it introduces more risk and no additional benefit. |
Im not following why. https://github.com/cloudberrydb/cloudberrydb/blob/978bab54358dc5331f9c7231aed38447f91f69f4/src/include/access/tableam.h#L1553-L1559
Yes, thats right. We are modifying data on QE whilst query planning is done on QD. So, we need to transfer knowledge between QE/QD. But turns out already have all pieces needed: Similar way we can send M.V.-invalidation messages from QE/QD |
Sure, we should keep table inheritance restriction code in place. I just trust executor much less that coding around TAM interfaces. This is more clear way IMO. |
I can actually develop an PoC PR for this in my free time. |
Other executor extensions do not call that am at all, all they need is a plan tree. |
understood. |
Can we also traverse the plan and check for ModifyTable nodes? This will cover all cases except triggers. |
I'm not sure, we could discuss it when fix that then. |
Though rules are not well supported in GPDB, we have to update matview data status if there were. Some SQL will generate like INSERT into another table which has relative matview. Authored-by: Zhang Mingli avamingli@gmail.com
Though rules are not well supported in GPDB, we have to update matview data status if there were.
Some SQL will generate like INSERT into another table which has relative matview.
Fix rules part issue of #582
Authored-by: Zhang Mingli avamingli@gmail.com
fix #ISSUE_Number
Change logs
Describe your change clearly, including what problem is being solved or what feature is being added.
If it has some breaking backward or forward compatibility, please clary.
Why are the changes needed?
Describe why the changes are necessary.
Does this PR introduce any user-facing change?
If yes, please clarify the previous behavior and the change this PR proposes.
How was this patch tested?
Please detail how the changes were tested, including manual tests and any relevant unit or integration tests.
Contributor's Checklist
Here are some reminders and checklists before/when submitting your pull request, please check them:
make installcheck
make -C src/test installcheck-cbdb-parallel
cloudberrydb/dev
team for review and approval when your PR is ready🥳