aboutsummaryrefslogtreecommitdiff
path: root/src/backend/commands/variable.c
diff options
context:
space:
mode:
authorBruce Momjian <bruce@momjian.us>1998-09-03 02:34:35 +0000
committerBruce Momjian <bruce@momjian.us>1998-09-03 02:34:35 +0000
commitfcecc5ca1ea350db1142fdae55ab7964ebafc0dc (patch)
treea297964d6df0db65ce8722a3d77df057920815d2 /src/backend/commands/variable.c
parentb25a513b49d355e9909c3b92cb3631cd8176bd12 (diff)
downloadpostgresql-fcecc5ca1ea350db1142fdae55ab7964ebafc0dc.tar.gz
postgresql-fcecc5ca1ea350db1142fdae55ab7964ebafc0dc.zip
[Part #1: Type: text/plain, Encoding: 7bit, Size: 59]
I will be cleaning this up more before the Oct 1 deadline. David Hartwig. AND/OR fix.
Diffstat (limited to 'src/backend/commands/variable.c')
-rw-r--r--src/backend/commands/variable.c50
1 files changed, 49 insertions, 1 deletions
diff --git a/src/backend/commands/variable.c b/src/backend/commands/variable.c
index 2c813dcd597..9cd2c5d699c 100644
--- a/src/backend/commands/variable.c
+++ b/src/backend/commands/variable.c
@@ -2,7 +2,7 @@
* 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 $
*
*/
@@ -24,6 +24,7 @@ extern Cost _cpu_index_page_wight_;
extern bool _use_geqo_;
extern int32 _use_geqo_rels_;
extern bool _use_right_sided_plans_;
+extern bool _use_keyset_query_optimizer;
/*-----------------------------------------------------------------------*/
static const char *
@@ -559,6 +560,9 @@ struct VariableParsers
},
#endif
{
+ "ksqo", parse_ksqo, show_ksqo, reset_ksqo
+ },
+ {
NULL, NULL, NULL, NULL
}
};
@@ -613,3 +617,47 @@ ResetPGVariable(const char *name)
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;
+}