Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 69b58d9

Browse files
committed
count rows removed by filter
1 parent 9d1abae commit 69b58d9

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

init.c

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -621,18 +621,19 @@ crossmatch_exec(CustomScanState *node)
621621

622622
ResetExprContext(node->ss.ps.ps_ProjInfo->pi_exprContext);
623623

624-
/* Check join conditions */
625-
node->ss.ps.ps_ExprContext->ecxt_scantuple = scanSlot;
626-
if (!ExecQual(node->ss.ps.qual, node->ss.ps.ps_ExprContext, false))
627-
continue;
628-
629624
node->ss.ps.ps_ProjInfo->pi_exprContext->ecxt_scantuple = scanSlot;
630625
resultSlot = ExecProject(node->ss.ps.ps_ProjInfo, &isDone);
631626

632627
if (isDone != ExprEndResult)
633628
{
634629
node->ss.ps.ps_TupFromTlist = (isDone == ExprMultipleResult);
635-
return resultSlot;
630+
631+
/* Check join conditions */
632+
node->ss.ps.ps_ExprContext->ecxt_scantuple = scanSlot;
633+
if (ExecQual(node->ss.ps.qual, node->ss.ps.ps_ExprContext, false))
634+
return resultSlot;
635+
else
636+
InstrCountFiltered1(node, 1);
636637
}
637638
else
638639
node->ss.ps.ps_TupFromTlist = false;
@@ -643,6 +644,8 @@ crossmatch_exec(CustomScanState *node)
643644
node->ss.ps.ps_ExprContext->ecxt_scantuple = scanSlot;
644645
if (ExecQual(node->ss.ps.qual, node->ss.ps.ps_ExprContext, false))
645646
return scanSlot;
647+
else
648+
InstrCountFiltered1(node, 1);
646649
}
647650
}
648651
}

0 commit comments

Comments
 (0)