-
Notifications
You must be signed in to change notification settings - Fork 136
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Fix: Add ao_unique_index_build test in greenplum_schedule #562
Conversation
By addressing the FIXME, this commit addresses 2 main issues: * We have to let the index AM know if a tuple is deleted. Failing to do the above can have consequences. There are some index AMs that don't really do anything with this information (like bitmap indexes). However, AMs like B-Tree rely on this information (specially for uniqueness conflicts during unique index builds). Below is an example of how things can go wrong if we bubble up incorrect visibility information: CREATE TABLE bar(i int) USING ao_row; INSERT INTO bar VALUES(1),(1); DELETE FROM bar WHERE i = 1; CREATE UNIQUE INDEX ON bar(i); ERROR: could not create unique index "bar_i_idx" (seg1 ...) DETAIL: Key (i)=(1) is duplicated. * If a tuple is deleted, we shouldn't add it to the table's reltuples on the segment. We were adding it regardless, leading to an incorrect value of reltuples. This commit introduces a visimap check to the table AM API for index builds, to weed out deleted tuples, such that the visibility info and reltuples calculation is correct. Further, it adds coverage for the reltuples calculation for general index builds and coverage for unique index builds.
39f7024
to
d71c4b9
Compare
|
Is the patch backported from greenplum? |
looks like greenplum-db/gpdb-archive@0c6e53f |
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.
Coding changes looks good, however i didnt get why we omit
src/test/regress/input/uao_dml/ao_unique_index_build.source
src/test/regress/output/uao_dml/ao_unique_index_build.source files from original commit
Yes, Its my fault to lost this PR when porting feature unique index. |
Sorry for my mistake. |
You need to sing CLA to commit to this repo |
Hi @reshke, thanks for the reminder. If the commits are cherry-picked from the upstream, there's no need to ask for the original author to sign the CLA. The CLA is one option that is not required for the pull request merging. |
Thanks, pushed. |
Test ao_unique_index_build test is lost in PR: Feature: Porting unique index for AO table to CBDB.
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🥳