I will be cleaning this up more before the Oct 1 deadline.
David Hartwig. AND/OR fix.
* Routines for handling of 'SET var TO',
* 'SHOW var' and 'RESET var' statements.
*
- * $Id: variable.c,v 1.12 1998/09/01 04:28:07 momjian Exp $
+ * $Id: variable.c,v 1.13 1998/09/03 02:34:29 momjian Exp $
*
*/
extern bool _use_geqo_;
extern int32 _use_geqo_rels_;
extern bool _use_right_sided_plans_;
+extern bool _use_keyset_query_optimizer;
/*-----------------------------------------------------------------------*/
static const char *
},
#endif
{
+ "ksqo", parse_ksqo, show_ksqo, reset_ksqo
+ },
+ {
NULL, NULL, NULL, NULL
}
};
return TRUE;
}
+
+
+/*-----------------------------------------------------------------------
+KSQO code will one day be unnecessary when the optimizer makes use of
+indexes when multiple ORs are specified in the where clause.
+See optimizer/prep/prepkeyset.c for more on this.
+ daveh@insightdist.com 6/16/98
+-----------------------------------------------------------------------*/
+bool
+parse_ksqo(const char *value)
+{
+ if (value == NULL)
+ {
+ reset_ksqo();
+ return TRUE;
+ }
+
+ if (strcasecmp(value, "on") == 0)
+ _use_keyset_query_optimizer = true;
+ else if (strcasecmp(value, "off") == 0)
+ _use_keyset_query_optimizer = false;
+ else
+ elog(ERROR, "Bad value for Key Set Query Optimizer (%s)", value);
+
+ return TRUE;
+}
+
+bool
+show_ksqo()
+{
+
+ if (_use_keyset_query_optimizer)
+ elog(NOTICE, "Key Set Query Optimizer is ON");
+ else
+ elog(NOTICE, "Key Set Query Optimizer is OFF");
+ return TRUE;
+}
+
+bool
+reset_ksqo()
+{
+ _use_keyset_query_optimizer = false;
+ return TRUE;
+}
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/optimizer/plan/planner.c,v 1.32 1998/09/01 04:29:53 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/optimizer/plan/planner.c,v 1.33 1998/09/03 02:34:30 momjian Exp $
*
*-------------------------------------------------------------------------
*/
PlannerInitPlan = NULL;
PlannerPlanId = 0;
+ transformKeySetQuery(parse);
result_plan = union_planner(parse);
Assert(PlannerQueryLevel == 1);
# Makefile for optimizer/prep
#
# IDENTIFICATION
-# $Header: /cvsroot/pgsql/src/backend/optimizer/prep/Makefile,v 1.7 1998/04/06 00:23:48 momjian Exp $
+# $Header: /cvsroot/pgsql/src/backend/optimizer/prep/Makefile,v 1.8 1998/09/03 02:34:32 momjian Exp $
#
#-------------------------------------------------------------------------
CFLAGS += -I../..
-OBJS = prepqual.o preptlist.o prepunion.o
+OBJS = prepqual.o preptlist.o prepunion.o prepkeyset.o
# not ready yet: predmig.o xfunc.o
* Headers for handling of 'SET var TO', 'SHOW var' and 'RESET var'
* statements
*
- * $Id: variable.h,v 1.6 1998/09/01 04:35:40 momjian Exp $
+ * $Id: variable.h,v 1.7 1998/09/03 02:34:34 momjian Exp $
*
*/
#ifndef VARIABLE_H
extern bool show_geqo(void);
extern bool reset_geqo(void);
extern bool parse_geqo(const char *);
+extern bool show_ksqo(void);
+extern bool reset_ksqo(void);
+extern bool parse_ksqo(const char *);
#endif /* VARIABLE_H */
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: planmain.h,v 1.15 1998/09/01 04:37:17 momjian Exp $
+ * $Id: planmain.h,v 1.16 1998/09/03 02:34:35 momjian Exp $
*
*-------------------------------------------------------------------------
*/
extern List *check_having_qual_for_aggs(Node *clause,
List *subplanTargetList, List *groupClause);
extern List *check_having_qual_for_vars(Node *clause, List *targetlist_so_far);
+extern void transformKeySetQuery(Query *origNode);
#endif /* PLANMAIN_H */