Free memory used for last stripe read when re-scanning a columnar table (#5143)

Instead of setting stripeReadState to NULL, call ColumnarResetRead
before re-scanning a columnar table since this function is already
designed for doing the necessary clean up when finishing a stripe
read.

Note that this change shouldn't have a great effect on memory usage
since AdvanceStripe was already doing the clean-up for all the
stripes except the last one.
pull/5090/head
Onur Tirtir 2021-08-02 11:16:01 +03:00 committed by GitHub
parent 38940ed2a6
commit d8f92697f2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -432,7 +432,7 @@ HasUnreadStripe(ColumnarReadState *readState)
void
ColumnarRescan(ColumnarReadState *readState)
{
readState->stripeReadState = NULL;
ColumnarResetRead(readState);
readState->currentStripeMetadata = FindNextStripeByRowNumber(readState->relation,
COLUMNAR_INVALID_ROW_NUMBER,
GetTransactionSnapshot());