Remove macros which is used to control level of WHERE clause push-down
authorShigeru Hanada <[email protected]>
Fri, 15 Oct 2010 08:58:30 +0000 (17:58 +0900)
committerShigeru Hanada <[email protected]>
Fri, 15 Oct 2010 08:58:30 +0000 (17:58 +0900)
in postgresql_fdw.

contrib/postgresql_fdw/postgresql_fdw.c

index 1fea110f3999a5705dcc38fa8079753821406f42..94a4af173d5e0b200f14a4b995b0b00c538dbd1c 100644 (file)
 
 PG_MODULE_MAGIC;
 
-/*
- * WHERE caluse optimization level
- */
-#define EVAL_QUAL_LOCAL        0   /* evaluate none in foreign, all in local */
-#define EVAL_QUAL_BOTH     1   /* evaluate some in foreign, all in local */
-#define EVAL_QUAL_FOREIGN  2   /* evaluate some in foreign, rest in local */
-
-#define OPTIMIZE_WHERE_CLAUSE  EVAL_QUAL_FOREIGN
-
 extern Datum postgresql_fdw_handler(PG_FUNCTION_ARGS);
 
 /*
@@ -326,10 +317,7 @@ deparseSql(ForeignScanState *scanstate)
    /*
     * Scanning multiple relations in a ForeignScan node is not supported.
     */
-   prefix = false;
-#if 0
    prefix = list_length(estate->es_range_table) > 1;
-#endif
 
    /* The alias of relation is used in both SELECT clause and FROM clause. */
    aliasname_q = quote_identifier(rte->eref->aliasname);
@@ -411,7 +399,6 @@ deparseSql(ForeignScanState *scanstate)
     * The Plan.qual is never changed, so multiple use of the Plan with
     * PREPARE/EXECUTE work properly.
     */
-#if OPTIMIZE_WHERE_CLAUSE > EVAL_QUAL_LOCAL
    if (scanstate->ss.ps.plan->qual)
    {
        List       *local_qual = NIL;
@@ -435,14 +422,13 @@ deparseSql(ForeignScanState *scanstate)
            else
                local_qual = lappend(local_qual, state);
        }
-#if OPTIMIZE_WHERE_CLAUSE == EVAL_QUAL_FOREIGN
+
        /*
         * If the optimization level is EVAL_QUAL_FOREIGN, replace the original
         * qual with the list of ExprStates which should be evaluated in the
         * local server.
         */
        scanstate->ss.ps.qual = local_qual;
-#endif
 
        /*
         * Deparse quals to be evaluated in the foreign server if any.
@@ -463,7 +449,6 @@ deparseSql(ForeignScanState *scanstate)
            list_free(foreign_expr);
        }
    }
-#endif
 
    elog(DEBUG1, "deparsed SQL is \"%s\"", sql.data);