Skip to content

Commit

Permalink
don't fetch ybidxbasectid unnecessarily
Browse files Browse the repository at this point in the history
  • Loading branch information
arpang committed Jan 11, 2025
1 parent d5440bc commit 1fef3af
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/postgres/src/backend/access/yb_access/yb_scan.c
Original file line number Diff line number Diff line change
Expand Up @@ -2688,7 +2688,7 @@ ybcBuildRequiredAttrs(YbScanDesc yb_scan, YbScanPlan scan_plan,
ybcAddNonDroppedAttr(target_desc, attnum, &result);
}

if (index && !index->rd_index->indisprimary && (yb_index_checker || !is_index_only_scan))
if (index && !index->rd_index->indisprimary && !is_index_only_scan)
ybcAttnumBmsAdd(&result, YBIdxBaseTupleIdAttributeNumber);

return result;
Expand Down
5 changes: 3 additions & 2 deletions src/postgres/src/backend/executor/nodeIndexonlyscan.c
Original file line number Diff line number Diff line change
Expand Up @@ -344,11 +344,12 @@ StoreIndexTuple(TupleTableSlot *slot, IndexTuple itup, TupleDesc itupdesc)
* the same number of columns though, as well as being datatype-compatible
* which is something we can't so easily check.
*/
// Assert(slot->tts_tupleDescriptor->natts == itupdesc->natts);
// TODO: itupdesc should contains baseybctid too. Why does it not contain it?
Assert(slot->tts_tupleDescriptor->natts == itupdesc->natts || yb_index_checker);

ExecClearTuple(slot);
index_deform_tuple(itup, itupdesc, slot->tts_values, slot->tts_isnull);
if (slot->tts_tupleDescriptor->natts == itupdesc->natts+1)
if (slot->tts_tupleDescriptor->natts == itupdesc->natts + 1)
{
slot->tts_isnull[slot->tts_tupleDescriptor->natts-1] = false;
slot->tts_values[slot->tts_tupleDescriptor->natts-1] = itup->t_ybctid;
Expand Down
4 changes: 2 additions & 2 deletions src/postgres/src/backend/parser/parse_relation.c
Original file line number Diff line number Diff line change
Expand Up @@ -3231,8 +3231,8 @@ get_rte_attribute_name(RangeTblEntry *rte, AttrNumber attnum)
if (attnum == YBTupleIdAttributeNumber)
return "ybctid";

if (attnum == YBIdxBaseTupleIdAttributeNumber)
return "ybidxbasectid";
// if (attnum == YBIdxBaseTupleIdAttributeNumber)
// return "ybidxbasectid";

/*
* If there is a user-written column alias, use it.
Expand Down

0 comments on commit 1fef3af

Please sign in to comment.