{
    SeqScanState *node = castNode(SeqScanState, pstate);
 
+   /*
+    * Use pg_assume() for != NULL tests to make the compiler realize no
+    * runtime check for the field is needed in ExecScanExtended().
+    */
    Assert(pstate->state->es_epq_active == NULL);
-   Assert(pstate->qual != NULL);
+   pg_assume(pstate->qual != NULL);
    Assert(pstate->ps_ProjInfo == NULL);
 
    return ExecScanExtended(&node->ss,
 
    Assert(pstate->state->es_epq_active == NULL);
    Assert(pstate->qual == NULL);
-   Assert(pstate->ps_ProjInfo != NULL);
+   pg_assume(pstate->ps_ProjInfo != NULL);
 
    return ExecScanExtended(&node->ss,
                            (ExecScanAccessMtd) SeqNext,
    SeqScanState *node = castNode(SeqScanState, pstate);
 
    Assert(pstate->state->es_epq_active == NULL);
-   Assert(pstate->qual != NULL);
-   Assert(pstate->ps_ProjInfo != NULL);
+   pg_assume(pstate->qual != NULL);
+   pg_assume(pstate->ps_ProjInfo != NULL);
 
    return ExecScanExtended(&node->ss,
                            (ExecScanAccessMtd) SeqNext,