Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitfcecc5c

Browse files
committed
[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.
1 parentb25a513 commitfcecc5c

File tree

5 files changed

+59
-6
lines changed

5 files changed

+59
-6
lines changed

‎src/backend/commands/variable.c

Lines changed: 49 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* Routines for handling of 'SET var TO',
33
*'SHOW var' and 'RESET var' statements.
44
*
5-
* $Id: variable.c,v 1.12 1998/09/01 04:28:07 momjian Exp $
5+
* $Id: variable.c,v 1.13 1998/09/03 02:34:29 momjian Exp $
66
*
77
*/
88

@@ -24,6 +24,7 @@ extern Cost _cpu_index_page_wight_;
2424
externbool_use_geqo_;
2525
externint32_use_geqo_rels_;
2626
externbool_use_right_sided_plans_;
27+
externbool_use_keyset_query_optimizer;
2728

2829
/*-----------------------------------------------------------------------*/
2930
staticconstchar*
@@ -558,6 +559,9 @@ struct VariableParsers
558559
"server_encoding",parse_server_encoding,show_server_encoding,reset_server_encoding
559560
},
560561
#endif
562+
{
563+
"ksqo",parse_ksqo,show_ksqo,reset_ksqo
564+
},
561565
{
562566
NULL,NULL,NULL,NULL
563567
}
@@ -613,3 +617,47 @@ ResetPGVariable(const char *name)
613617

614618
return TRUE;
615619
}
620+
621+
622+
/*-----------------------------------------------------------------------
623+
KSQO code will one day be unnecessary when the optimizer makes use of
624+
indexes when multiple ORs are specified in the where clause.
625+
See optimizer/prep/prepkeyset.c for more on this.
626+
daveh@insightdist.com 6/16/98
627+
-----------------------------------------------------------------------*/
628+
bool
629+
parse_ksqo(constchar*value)
630+
{
631+
if (value==NULL)
632+
{
633+
reset_ksqo();
634+
return TRUE;
635+
}
636+
637+
if (strcasecmp(value,"on")==0)
638+
_use_keyset_query_optimizer= true;
639+
elseif (strcasecmp(value,"off")==0)
640+
_use_keyset_query_optimizer= false;
641+
else
642+
elog(ERROR,"Bad value for Key Set Query Optimizer (%s)",value);
643+
644+
return TRUE;
645+
}
646+
647+
bool
648+
show_ksqo()
649+
{
650+
651+
if (_use_keyset_query_optimizer)
652+
elog(NOTICE,"Key Set Query Optimizer is ON");
653+
else
654+
elog(NOTICE,"Key Set Query Optimizer is OFF");
655+
return TRUE;
656+
}
657+
658+
bool
659+
reset_ksqo()
660+
{
661+
_use_keyset_query_optimizer= false;
662+
return TRUE;
663+
}

‎src/backend/optimizer/plan/planner.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/optimizer/plan/planner.c,v 1.32 1998/09/01 04:29:53 momjian Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/optimizer/plan/planner.c,v 1.33 1998/09/03 02:34:30 momjian Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -68,6 +68,7 @@ planner(Query *parse)
6868
PlannerInitPlan=NULL;
6969
PlannerPlanId=0;
7070

71+
transformKeySetQuery(parse);
7172
result_plan=union_planner(parse);
7273

7374
Assert(PlannerQueryLevel==1);

‎src/backend/optimizer/prep/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# Makefile for optimizer/prep
55
#
66
# IDENTIFICATION
7-
# $Header: /cvsroot/pgsql/src/backend/optimizer/prep/Makefile,v 1.7 1998/04/06 00:23:48 momjian Exp $
7+
# $Header: /cvsroot/pgsql/src/backend/optimizer/prep/Makefile,v 1.8 1998/09/03 02:34:32 momjian Exp $
88
#
99
#-------------------------------------------------------------------------
1010

@@ -13,7 +13,7 @@ include ../../../Makefile.global
1313

1414
CFLAGS += -I../..
1515

16-
OBJS = prepqual.o preptlist.o prepunion.o
16+
OBJS = prepqual.o preptlist.o prepunion.o prepkeyset.o
1717

1818
# not ready yet: predmig.o xfunc.o
1919

‎src/include/commands/variable.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* Headers for handling of 'SET var TO', 'SHOW var' and 'RESET var'
33
* statements
44
*
5-
* $Id: variable.h,v 1.6 1998/09/01 04:35:40 momjian Exp $
5+
* $Id: variable.h,v 1.7 1998/09/03 02:34:34 momjian Exp $
66
*
77
*/
88
#ifndefVARIABLE_H
@@ -54,5 +54,8 @@ extern bool set_geqo(void);
5454
externboolshow_geqo(void);
5555
externboolreset_geqo(void);
5656
externboolparse_geqo(constchar*);
57+
externboolshow_ksqo(void);
58+
externboolreset_ksqo(void);
59+
externboolparse_ksqo(constchar*);
5760

5861
#endif/* VARIABLE_H */

‎src/include/optimizer/planmain.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
*
77
* Copyright (c) 1994, Regents of the University of California
88
*
9-
* $Id: planmain.h,v 1.15 1998/09/01 04:37:17 momjian Exp $
9+
* $Id: planmain.h,v 1.16 1998/09/03 02:34:35 momjian Exp $
1010
*
1111
*-------------------------------------------------------------------------
1212
*/
@@ -61,5 +61,6 @@ extern void del_agg_tlist_references(List *tlist);
6161
externList*check_having_qual_for_aggs(Node*clause,
6262
List*subplanTargetList,List*groupClause);
6363
externList*check_having_qual_for_vars(Node*clause,List*targetlist_so_far);
64+
externvoidtransformKeySetQuery(Query*origNode);
6465

6566
#endif/* PLANMAIN_H */

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp