Skip to content

Comments

Issue #535: Assign fake ctid only when PK is not ctid#549

Merged
akorotkov merged 1 commit intomainfrom
issue_535_analyze_detoast
Sep 7, 2025
Merged

Issue #535: Assign fake ctid only when PK is not ctid#549
akorotkov merged 1 commit intomainfrom
issue_535_analyze_detoast

Conversation

@za-arthur
Copy link
Contributor

@za-arthur za-arthur commented Sep 3, 2025

orioledb_acquire_sample_rows() assigns fake ctid to slot->tts_tid, ExecCopySlotHeapTuple() reads all attributes of tuples and copies them to rows array as HeapTuple by calling tts_orioledb_getsomeattrs(). tts_orioledb_getsomeattrs() also assigns ctid of a tuple if it has TOAST values to detoast it later during ANALYZE:

pkey = tts_orioledb_make_key(slot, descr);

If we assign fake ctid if PK is ctid then we won't be able to detoast later.

Issue #535

@za-arthur za-arthur force-pushed the issue_535_analyze_detoast branch from b32369b to b54d399 Compare September 3, 2025 19:16
@za-arthur za-arthur changed the title Issue #535: Assign fake ctid after reading tuples attributes Issue #535: Assign fake ctid only when PK is not ctid Sep 3, 2025
orioledb_acquire_sample_rows() assings fake ctid to slot->tts_tid,
ExecCopySlotHeapTuple() reads all attributes of tuples and copies them
to rows array as HeapTuple by calling tts_orioledb_getsomeattrs().
tts_orioledb_getsomeattrs() also assings ctid of a tuple if it has TOAST
values to detoast it later during ANALYZE.

If we assign fake ctid if PK is ctid then we won't be able to detoast
later.
@za-arthur za-arthur force-pushed the issue_535_analyze_detoast branch from b54d399 to 24e0dea Compare September 3, 2025 19:20
@coveralls
Copy link

Pull Request Test Coverage Report for Build 17443819471

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 34 unchanged lines in 8 files lost coverage.
  • Overall coverage decreased (-0.02%) to 89.755%

Files with Coverage Reduction New Missed Lines %
orioledb/src/btree/find.c 1 89.76%
orioledb/src/btree/scan.c 1 90.82%
orioledb/src/catalog/ddl.c 1 83.18%
orioledb/src/s3/headers.c 2 90.8%
orioledb/src/recovery/recovery.c 4 93.27%
orioledb/src/recovery/logical.c 5 83.58%
orioledb/src/tableam/handler.c 9 86.96%
orioledb/src/checkpoint/checkpoint.c 11 90.6%
Totals Coverage Status
Change from base Build 17437203951: -0.02%
Covered Lines: 41809
Relevant Lines: 46581

💛 - Coveralls

@akorotkov akorotkov merged commit 9d1e179 into main Sep 7, 2025
108 checks passed
@za-arthur za-arthur deleted the issue_535_analyze_detoast branch October 22, 2025 10:25
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.

3 participants