1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-03 20:02:46 +03:00

[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.
This commit is contained in:
Bruce Momjian
1998-09-03 02:34:35 +00:00
parent b25a513b49
commit fcecc5ca1e
5 changed files with 59 additions and 6 deletions

View File

@ -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 *
@ -558,6 +559,9 @@ struct VariableParsers
"server_encoding", parse_server_encoding, show_server_encoding, reset_server_encoding
},
#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;
}