Skip to content

Commit

Permalink
Refactor SeqNext() for more efficient and readable.
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangyue-hashdata committed Dec 15, 2024
1 parent 768f623 commit bcf93e6
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions src/backend/executor/nodeSeqscan.c
Original file line number Diff line number Diff line change
Expand Up @@ -101,14 +101,22 @@ SeqNext(SeqScanState *node)
/*
* get the next tuple from the table
*/
while (table_scan_getnextslot(scandesc, direction, slot))
if (node->filter_in_seqscan && node->filters)
{
if (node->filter_in_seqscan && node->filters &&
!PassByBloomFilter(node, slot))
continue;
while (table_scan_getnextslot(scandesc, direction, slot))
{
if (!PassByBloomFilter(node, slot))
continue;

return slot;
return slot;
}
}
else
{
if (table_scan_getnextslot(scandesc, direction, slot))
return slot;
}

return NULL;
}

Expand Down

0 comments on commit bcf93e6

Please sign in to comment.