Skip to content

Commit

Permalink
[CBRD-24555] The spage_collect_statistics function should consider re…
Browse files Browse the repository at this point in the history
…cords deleted by vacuum when calculating the number of records in a data page (#3944)

http://jira.cubrid.org/browse/CBRD-24555

Description

handled the requirements not to count vacuumed records in the spage_collect_statistics function
however, vacuumed records are not already being counted
// spage_vacuum_slot()
slot_p->offset_to_record = SPAGE_EMPTY_OFFSET;

// spage_collect_statistics()
if (slot_p->offset_to_record == SPAGE_EMPTY_OFFSET)
  {
    continue;
  }
but, I modified it for the following reasons
more intuitive to use slot_p->record_type instead of slot_p->offset_to_record in the spage_collect_statistics function
the spage_mark_deleted_slot_as_reusable function does not set slot_p->offset_to_record to SPAGE_EMPTY_OFFSET
defensive code by quick fix - leave 'if (slot_p->offset_to_record == SPAGE_EMPTY_OFFSET)' as it is
  • Loading branch information
hornetmj authored Nov 16, 2022
1 parent 7c0ada6 commit 41737e4
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/storage/slotted_page.c
Original file line number Diff line number Diff line change
Expand Up @@ -1033,6 +1033,8 @@ spage_collect_statistics (PAGE_PTR page_p, int *npages, int *nrecords, int *rec_
{
if (slot_p->offset_to_record == SPAGE_EMPTY_OFFSET)
{
assert (slot_p->record_type == REC_MARKDELETED || slot_p->record_type == REC_DELETED_WILL_REUSE);

continue;
}

Expand Down

0 comments on commit 41737e4

Please sign in to comment.