Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
f1b78234
Commit
f1b78234
authored
Feb 02, 1999
by
Bruce Momjian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make GEQO use dependent on table and index count.
parent
eb341553
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
37 additions
and
15 deletions
+37
-15
doc/src/sgml/ref/set.sgml
doc/src/sgml/ref/set.sgml
+6
-1
src/backend/optimizer/path/allpaths.c
src/backend/optimizer/path/allpaths.c
+15
-10
src/backend/parser/gram.c
src/backend/parser/gram.c
+13
-1
src/man/set.l
src/man/set.l
+3
-3
No files found.
doc/src/sgml/ref/set.sgml
View file @
f1b78234
...
...
@@ -406,7 +406,7 @@ SET TIME ZONE { '<REPLACEABLE CLASS="PARAMETER">timezone</REPLACEABLE>' | LOCAL
</para>
<para>
This algorithm is on by default, which used GEQO for
statements of six or more tables.
statements of six or more tables
and indexes
.
(See the chapter on GEQO in the Programmer's Guide
for more information).
</para>
...
...
@@ -676,6 +676,11 @@ SET TIME ZONE { '<REPLACEABLE CLASS="PARAMETER">timezone</REPLACEABLE>' | LOCAL
--
SET DATESTYLE TO 'ISO';
</programlisting>
<programlisting>
--Enable GEQO for queries with 4 or more tables and indexes
--
SET GEQO ON=4;
</programlisting>
<programlisting>
--Set GEQO to default:
--
...
...
src/backend/optimizer/path/allpaths.c
View file @
f1b78234
...
...
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/allpaths.c,v 1.2
3 1998/09/01 04:29:27
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/allpaths.c,v 1.2
4 1999/02/02 20:30:05
momjian Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -78,7 +78,6 @@ find_paths(Query *root, List *rels)
if
(
levels_needed
<=
1
)
{
/*
* Unsorted single relation, no more processing is required.
*/
...
...
@@ -86,7 +85,6 @@ find_paths(Query *root, List *rels)
}
else
{
/*
* this means that joins or sorts are required. set selectivities
* of clauses that have not been set by an index.
...
...
@@ -123,7 +121,7 @@ find_rel_paths(Query *root, List *rels)
rel_index_scan_list
=
find_index_paths
(
root
,
rel
,
find_relation_indices
(
root
,
rel
),
find_relation_indices
(
root
,
rel
),
rel
->
clauseinfo
,
rel
->
joininfo
);
...
...
@@ -182,18 +180,27 @@ find_join_paths(Query *root, List *outer_rels, int levels_needed)
* genetic query optimizer entry point *
* <utesch@aut.tu-freiberg.de> *
*******************************************/
{
List
*
temp
;
int
paths_to_consider
=
0
;
if
((
_use_geqo_
)
&&
length
(
root
->
base_rel_list
)
>=
_use_geqo_rels_
)
return
lcons
(
geqo
(
root
),
NIL
);
/* returns *one* RelOptInfo, so
* lcons it */
foreach
(
temp
,
outer_rels
)
{
RelOptInfo
*
rel
=
(
RelOptInfo
*
)
lfirst
(
temp
);
paths_to_consider
+=
length
(
rel
->
pathlist
);
}
if
((
_use_geqo_
)
&&
paths_to_consider
>=
_use_geqo_rels_
)
/* returns _one_ RelOptInfo, so lcons it */
return
lcons
(
geqo
(
root
),
NIL
);
}
/*******************************************
* rest will be deprecated in case of GEQO *
*******************************************/
while
(
--
levels_needed
)
{
/*
* Determine all possible pairs of relations to be joined at this
* level. Determine paths for joining these relation pairs and
...
...
@@ -207,7 +214,6 @@ find_join_paths(Query *root, List *outer_rels, int levels_needed)
prune_joinrels
(
new_rels
);
#if 0
/*
* * for each expensive predicate in each path in each distinct
* rel, * consider doing pullup -- JMH
...
...
@@ -247,7 +253,6 @@ find_join_paths(Query *root, List *outer_rels, int levels_needed)
if
(
BushyPlanFlag
)
{
/*
* prune rels that have been completely incorporated into new
* join rels
...
...
src/backend/parser/gram.c
View file @
f1b78234
...
...
@@ -240,7 +240,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/parser/Attic/gram.c,v 2.6
6 1999/02/02 03:44:34
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/parser/Attic/gram.c,v 2.6
7 1999/02/02 20:30:07
momjian Exp $
*
* HISTORY
* AUTHOR DATE MAJOR EVENT
...
...
@@ -11450,11 +11450,17 @@ static Node *makeIndexable(char *opname, Node *lexpr, Node *rexpr)
least
->
val
.
val
.
str
=
match_least
;
most
->
val
.
type
=
T_String
;
most
->
val
.
val
.
str
=
match_most
;
#ifdef USE_LOCALE
result
=
makeA_Expr
(
AND
,
NULL
,
makeA_Expr
(
OP
,
"~"
,
lexpr
,
rexpr
),
makeA_Expr
(
OP
,
">="
,
lexpr
,
(
Node
*
)
least
));
#else
result
=
makeA_Expr
(
AND
,
NULL
,
makeA_Expr
(
OP
,
"~"
,
lexpr
,
rexpr
),
makeA_Expr
(
AND
,
NULL
,
makeA_Expr
(
OP
,
">="
,
lexpr
,
(
Node
*
)
least
),
makeA_Expr
(
OP
,
"<="
,
lexpr
,
(
Node
*
)
most
)));
#endif
}
}
}
...
...
@@ -11497,11 +11503,17 @@ static Node *makeIndexable(char *opname, Node *lexpr, Node *rexpr)
least
->
val
.
val
.
str
=
match_least
;
most
->
val
.
type
=
T_String
;
most
->
val
.
val
.
str
=
match_most
;
#ifdef USE_LOCALE
result
=
makeA_Expr
(
AND
,
NULL
,
makeA_Expr
(
OP
,
"~~"
,
lexpr
,
rexpr
),
makeA_Expr
(
OP
,
">="
,
lexpr
,
(
Node
*
)
least
));
#else
result
=
makeA_Expr
(
AND
,
NULL
,
makeA_Expr
(
OP
,
"~~"
,
lexpr
,
rexpr
),
makeA_Expr
(
AND
,
NULL
,
makeA_Expr
(
OP
,
">="
,
lexpr
,
(
Node
*
)
least
),
makeA_Expr
(
OP
,
"<="
,
lexpr
,
(
Node
*
)
most
)));
#endif
}
}
}
...
...
src/man/set.l
View file @
f1b78234
.\" This is -*-nroff-*-
.\" XXX standard disclaimer belongs here....
.\" $Header: /cvsroot/pgsql/src/man/Attic/set.l,v 1.1
2 1999/02/02 03:45:33
momjian Exp $
.\" $Header: /cvsroot/pgsql/src/man/Attic/set.l,v 1.1
3 1999/02/02 20:30:18
momjian Exp $
.TH SET SQL 05/14/97 PostgreSQL PostgreSQL
.SH NAME
set - set run-time parameters for session
...
...
@@ -44,7 +44,7 @@ determines the output format for the date and time data types.
.IR GEQO
enables or disables the genetic optimizer algorithm. This algorithm is
.IR on
by default, which used GEQO for statements of six or more tables.
by default, which used GEQO for statements of six or more tables
and indexes
.
Set the
.IR Programmer's Guide
for more information.
...
...
@@ -101,7 +101,7 @@ set DateStyle to 'SQL,European'
.PP
.nf
--
--Use GEQO for statements with 4 or more tables
--Use GEQO for statements with 4 or more tables
and indexes
--
set GEQO to 'on=4'
--
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment