-
Notifications
You must be signed in to change notification settings - Fork 883
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
Allow hypertable constraint creation USING INDEX #7040
base: main
Are you sure you want to change the base?
Allow hypertable constraint creation USING INDEX #7040
Conversation
32859da
to
5878a37
Compare
5e03859
to
9c82c96
Compare
Hmm ideally we remove the pg constraint tracking from chunk_constraint then we wouldnt need to do anything special for constraint creation with index. |
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.
I dont think the functions that copies constraints to chunks works like this. It is missing handling for constraint columns. None of the tests you added actually utilize the code you added in that function.
99090d7
to
aa519a8
Compare
A lot of tests are failing. |
5d11129
to
346d57d
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #7040 +/- ##
==========================================
+ Coverage 80.06% 81.78% +1.71%
==========================================
Files 190 204 +14
Lines 37181 38144 +963
Branches 9450 9892 +442
==========================================
+ Hits 29770 31197 +1427
+ Misses 2997 2964 -33
+ Partials 4414 3983 -431 ☔ View full report in Codecov by Sentry. |
@@ -2020,7 +2021,7 @@ process_rename_index(ProcessUtilityArgs *args, Cache *hcache, Oid relid, RenameS | |||
Chunk *chunk = ts_chunk_get_by_relid(tablerelid, false); | |||
|
|||
if (NULL != chunk) | |||
ts_chunk_index_rename(chunk, relid, stmt->newname); | |||
ts_chunk_index_rename(chunk, indexname, stmt->newname); |
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.
curious why we don't have coverage for this code path
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.
@fabriziomello , IIUC, this is not a problem with this PR? should we address it separately?
346d57d
to
26d40f0
Compare
Before this commit, the following operation was disallowed: ```sql ALTER TABLE foo ADD CONSTRAINT foo_pkey PRIMARY KEY USING INDEX foo_pkey ``` pgcopydb, the tool that powers our migration process[1], handles primary key and unique constraint migrations in two steps: 1. Build unique indexes. 2. Create the unique constraint or primary key using the unique index created in step 1. This multi-step approach is useful for reducing the time spent on EXCLUSIVE LOCKS while building unique constraints or primary keys. [1] https://docs.timescale.com/migrate/latest/live-migration/ Signed-off-by: Arunprasad Rajkumar <[email protected]>
1546932
to
ad5ef73
Compare
ad5ef73
to
1546932
Compare
@fabriziomello Thanks for reviewing this PR. I've addressed your concerns, PTAL. |
Before this commit, the following operation was disallowed:
pgcopydb, the tool that powers our migration process[1], handles primary key
and unique constraint migrations in two steps:
in step 1.
This multi-step approach is useful for reducing the time spent on
EXCLUSIVE LOCKS while building unique constraints or primary keys.
[1] https://docs.timescale.com/migrate/latest/live-migration/
Fixes DAT-36
https://linear.app/timescale/issue/DAT-36