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

Commit748e300

Browse files
committed
Fix for AND/OR handling.
1 parent06b8c8a commit748e300

File tree

3 files changed

+26
-15
lines changed

3 files changed

+26
-15
lines changed

‎src/backend/optimizer/path/indxpath.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/indxpath.c,v 1.34 1998/09/01 04:29:33 momjian Exp $
11+
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/indxpath.c,v 1.35 1998/09/21 15:41:26 momjian Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -1293,8 +1293,13 @@ index_innerjoin(Query *root, RelOptInfo * rel, List *clausegroup_list,
12931293
length(clausegroup),
12941294
&temp_pages,
12951295
&temp_selec);
1296+
12961297
pathnode->path.pathtype=T_IndexScan;
12971298
pathnode->path.parent=rel;
1299+
pathnode->path.p_ordering.ordtype=SORTOP_ORDER;
1300+
pathnode->path.p_ordering.ord.sortop=index->ordering;
1301+
pathnode->path.keys=NIL;/* not sure about this, bjm 1998/09/21 */
1302+
12981303
pathnode->indexid=index->relids;
12991304
pathnode->indexkeys=index->indexkeys;
13001305
pathnode->indexqual=clausegroup;

‎src/backend/optimizer/path/orindxpath.c

Lines changed: 10 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/path/orindxpath.c,v 1.11 1998/09/01 04:29:41 momjian Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/orindxpath.c,v 1.12 1998/09/21 15:41:27 momjian Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -104,6 +104,15 @@ create_or_index_paths(Query *root,
104104

105105
pathnode->path.pathtype=T_IndexScan;
106106
pathnode->path.parent=rel;
107+
pathnode->path.p_ordering.ordtype=SORTOP_ORDER;
108+
/*
109+
*This is an IndexScan, but it does index lookups based
110+
*on the order of the fields specified in the WHERE clause,
111+
*not in any order, so the sortop is NULL.
112+
*/
113+
pathnode->path.p_ordering.ord.sortop=NULL;
114+
pathnode->path.keys=NIL;/* not sure about this, bjm 1998/09/21 */
115+
107116
pathnode->indexqual=lcons(clausenode,NIL);
108117
pathnode->indexid=indexids;
109118
pathnode->path.path_cost=cost;

‎src/backend/optimizer/util/pathnode.c

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/optimizer/util/pathnode.c,v 1.12 1998/09/01 04:30:08 momjian Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/optimizer/util/pathnode.c,v 1.13 1998/09/21 15:41:28 momjian Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -355,20 +355,17 @@ create_index_path(Query *root,
355355
&npages,
356356
&selec);
357357
/* each clause gets an equal selectivity */
358-
clausesel=
359-
pow(selec,
360-
1.0 / (double)length(restriction_clauses));
358+
clausesel=pow(selec,1.0 / (double)length(restriction_clauses));
361359

362360
pathnode->indexqual=restriction_clauses;
363-
pathnode->path.path_cost=
364-
cost_index(lfirsti(index->relids),
365-
(int)npages,
366-
selec,
367-
rel->pages,
368-
rel->tuples,
369-
index->pages,
370-
index->tuples,
371-
false);
361+
pathnode->path.path_cost=cost_index(lfirsti(index->relids),
362+
(int)npages,
363+
selec,
364+
rel->pages,
365+
rel->tuples,
366+
index->pages,
367+
index->tuples,
368+
false);
372369

373370
#if0
374371
/* add in expensive functions cost! -- JMH, 7/7/92 */

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp