Skip to content
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

Implement same-table concurrency using Postgres CTID column. #410

Merged
merged 4 commits into from
Aug 9, 2023

Conversation

dimitri
Copy link
Owner

@dimitri dimitri commented Jul 31, 2023

The Postgres system column "ctid" is the physical location of the row version within its table. It is encoded using the tid datatype: (pagenumber,rownumber).

Every single Postgres table has a "ctid" column and it is always possible to split a table's contents by using ctid based ranges. The question of this approach being good at reducing pgcopydb timings remains open: this PR is meant for allowing more experimentations.

Copy link

@marcocitus marcocitus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

High level note: Not all table access methods naturally support TID Scan (e.g. Citus Columnar does not), in which case this approach is probably much worse than a single-threaded full table scan.

Might be best to limit to heap / an allowlist of table access methods.

@dimitri dimitri force-pushed the feature/split-using-ctid branch 4 times, most recently from 5b94f31 to 1bf0ec2 Compare August 3, 2023 16:46
The Postgres system column "ctid" is the physical location of the row
version within its table. It is encoded using the tid datatype:
`(pagenumber,rownumber)`.

Every single Postgres table has a "ctid" column and it is always possible to
split a table's contents by using ctid based ranges. The question of this
approach being good at reducing pgcopydb timings remains open: this PR is
meant for allowing more experimentations.
TID scan might not be supported by other Table AM (such as Citus Columnar).
@dimitri dimitri merged commit f348a87 into main Aug 9, 2023
15 checks passed
@dimitri dimitri deleted the feature/split-using-ctid branch August 9, 2023 15:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants