gpdb icon indicating copy to clipboard operation
gpdb copied to clipboard

Fix CO sampling crashed on added column

Open haolinw opened this issue 1 year ago • 0 comments

Sampling on CO tables requires all columns sub-segfiles have the same total tupcount presented physically, ADD COLUMN operation didn't populate physical rows which have default values for better performance. This would break the assumption as the new added column may have less phyical rows than the anchor column, result in sampling scan may exceed EOF on new added columns.

The solution of above issue is, after getting the target rowNum of the anchor column (aka phyrow), fetch the same rowNum as phyrow for the rest non-anchor columns instead of re-caculating the target rowNum for each column.

Dev-pipeline: https://dev.ci.gpdb.pivotal.io/teams/main/pipelines/hw-7X-debug-ao-sampling

Here are some reminders before you submit the pull request

  • [ ] Add tests for the change
  • [ ] Document changes
  • [ ] Communicate in the mailing list if needed
  • [ ] Pass make installcheck
  • [ ] Review a PR in return to support the community

haolinw avatar Apr 22 '24 02:04 haolinw