Skip to content

Commit bcf93e6

Browse files
Refactor SeqNext() for more efficient and readable.
1 parent 768f623 commit bcf93e6

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

src/backend/executor/nodeSeqscan.c

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -101,14 +101,22 @@ SeqNext(SeqScanState *node)
101101
/*
102102
* get the next tuple from the table
103103
*/
104-
while (table_scan_getnextslot(scandesc, direction, slot))
104+
if (node->filter_in_seqscan && node->filters)
105105
{
106-
if (node->filter_in_seqscan && node->filters &&
107-
!PassByBloomFilter(node, slot))
108-
continue;
106+
while (table_scan_getnextslot(scandesc, direction, slot))
107+
{
108+
if (!PassByBloomFilter(node, slot))
109+
continue;
109110

110-
return slot;
111+
return slot;
112+
}
111113
}
114+
else
115+
{
116+
if (table_scan_getnextslot(scandesc, direction, slot))
117+
return slot;
118+
}
119+
112120
return NULL;
113121
}
114122

0 commit comments

Comments
 (0)