Skip to content

Commit

Permalink
[columnar] Adjust row number with vectorized batch reading
Browse files Browse the repository at this point in the history
* If row is deleted we don't write data or any other information in
  vector
* Flushed row mask should increase current command id for tuple
  visibility
  • Loading branch information
mkaruza authored and wuputah committed Feb 10, 2023
1 parent cabe2b1 commit 7e15b4c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions columnar/src/backend/columnar/columnar_metadata.c
Original file line number Diff line number Diff line change
Expand Up @@ -972,6 +972,8 @@ void FlushRowMaskCache(RowMaskWriteStateEntry *rowMaskEntry)

systable_endscan_ordered(scanDescriptor);
table_close(columnarChunkGroupMask, AccessShareLock);

CommandCounterIncrement();
}


Expand Down
4 changes: 2 additions & 2 deletions columnar/src/backend/columnar/columnar_reader.c
Original file line number Diff line number Diff line change
Expand Up @@ -1995,6 +1995,7 @@ ReadChunkGroupNextVector(ChunkGroupReadState *chunkGroupReadState, Datum *column
memset(columnNulls, true, sizeof(bool) * chunkGroupReadState->columnCount);

int i;
int rowNumberIndex = 0;

for (i = 0; i < chunkGroupReadState->rowCount; i ++)
{
Expand All @@ -2013,7 +2014,6 @@ ReadChunkGroupNextVector(ChunkGroupReadState *chunkGroupReadState, Datum *column
{
(*chunkReadRows)++;
chunkGroupReadState->currentRow++;
rowNumber[i] = stripeFirstRowNumber + chunkGroupReadState->currentRow - 1;
continue;
}
}
Expand Down Expand Up @@ -2048,7 +2048,7 @@ ReadChunkGroupNextVector(ChunkGroupReadState *chunkGroupReadState, Datum *column

(*chunkReadRows)++;
chunkGroupReadState->currentRow++;
rowNumber[i] = stripeFirstRowNumber + chunkGroupReadState->currentRow - 1;
rowNumber[rowNumberIndex++] = stripeFirstRowNumber + chunkGroupReadState->currentRow - 1;
}

return true;
Expand Down

0 comments on commit 7e15b4c

Please sign in to comment.