|
2 | 2 | * Routines for handling of 'SET var TO', 'SHOW var' and 'RESET var'
|
3 | 3 | * statements.
|
4 | 4 | *
|
5 |
| - * $Id: variable.c,v 1.8 1997/05/16 07:24:13 thomas Exp $ |
| 5 | + * $Id: variable.c,v 1.9 1997/05/20 10:31:42 vadim Exp $ |
6 | 6 | *
|
7 | 7 | */
|
8 | 8 |
|
|
17 | 17 | extern Cost _cpu_page_wight_;
|
18 | 18 | extern Cost _cpu_index_page_wight_;
|
19 | 19 | extern bool _use_geqo_;
|
| 20 | +extern bool _use_right_sided_plans_; |
20 | 21 |
|
21 | 22 | /*-----------------------------------------------------------------------*/
|
22 | 23 | #if USE_EURODATES
|
@@ -104,6 +105,40 @@ static bool reset_geqo ()
|
104 | 105 | return TRUE;
|
105 | 106 | }
|
106 | 107 |
|
| 108 | +static bool parse_r_plans (const char *value) |
| 109 | +{ |
| 110 | + |
| 111 | + if ( strcasecmp (value, "on") == 0 ) |
| 112 | + _use_right_sided_plans_ = true; |
| 113 | + else if ( strcasecmp (value, "off") == 0 ) |
| 114 | + _use_right_sided_plans_ = false; |
| 115 | + else |
| 116 | + elog(WARN, "Bad value for Right-sided Plans (%s)", value); |
| 117 | + |
| 118 | + return TRUE; |
| 119 | +} |
| 120 | + |
| 121 | +static bool show_r_plans () |
| 122 | +{ |
| 123 | + |
| 124 | + if ( _use_right_sided_plans_ ) |
| 125 | + elog (NOTICE, "Right-sided Plans are ON"); |
| 126 | + else |
| 127 | + elog (NOTICE, "Right-sided Plans are OFF"); |
| 128 | + return TRUE; |
| 129 | +} |
| 130 | + |
| 131 | +static bool reset_r_plans () |
| 132 | +{ |
| 133 | + |
| 134 | +#ifdef USE_RIGHT_SIDED_PLANS |
| 135 | + _use_right_sided_plans_ = true; |
| 136 | +#else |
| 137 | + _use_right_sided_plans_ = false; |
| 138 | +#endif |
| 139 | + return TRUE; |
| 140 | +} |
| 141 | + |
107 | 142 | static bool parse_cost_heap (const char *value)
|
108 | 143 | {
|
109 | 144 | float32 res = float4in ((char*)value);
|
@@ -250,6 +285,7 @@ struct VariableParsers
|
250 | 285 | { "cost_index", parse_cost_index,
|
251 | 286 | show_cost_index, reset_cost_index },
|
252 | 287 | { "geqo", parse_geqo, show_geqo, reset_geqo },
|
| 288 | + { "r_plans", parse_r_plans, show_r_plans, reset_r_plans }, |
253 | 289 | { NULL, NULL, NULL }
|
254 | 290 | };
|
255 | 291 |
|
|
0 commit comments