-
Notifications
You must be signed in to change notification settings - Fork 878
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
Cache table AM in Chunk struct #7284
base: main
Are you sure you want to change the base?
Conversation
A chunk can use different table access methods so to support this more easily, cache the AM oid in the chunk struct. This allows identifying the access method quickly at, e.g., planning time.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #7284 +/- ##
===========================================
+ Coverage 80.06% 92.30% +12.23%
===========================================
Files 190 205 +15
Lines 37181 38442 +1261
Branches 9450 9964 +514
===========================================
+ Hits 29770 35484 +5714
+ Misses 2997 2954 -43
+ Partials 4414 4 -4410 ☔ View full report in Codecov by Sentry. |
@@ -1620,6 +1620,7 @@ chunk_tuple_found(TupleInfo *ti, void *arg) | |||
chunk->hypertable_relid = ts_hypertable_id_to_relid(chunk->fd.hypertable_id, false); | |||
|
|||
chunk->relkind = get_rel_relkind(chunk->table_id); | |||
chunk->amoid = ts_get_rel_am(chunk->table_id); |
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.
Some observations on this:
-
I think you should add this to
ts_chunk_scan_by_chunk_ids
as well. Probably a good idea to do a catalog lookup once, because the relkind and amoid are in the same pg_class catalog. Maybe you can make a function and use it here and there as well. -
It's not failing, so this means it's dead code now. Let's add some assertion that this is not null to improve test coverage.
I think we can merge much more parts of the TAM planning in this PR in the following way:
This way we can actually test the place where I saw the regression in this PR, which was my original motivation to suggest splitting it. And also remove much more changes from the TAM PR. What do you think? |
A chunk can use different table access methods so to support this more easily, cache the AM oid in the chunk struct. This allows identifying the access method quickly at, e.g., planning time.
Disable-check: force-changelog-file