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

Commitaddc42c

Browse files
committed
Create the planner mechanism for optimizing simple MIN and MAX queries
into indexscans on matching indexes. For the moment, it only handlesint4 and text datatypes; next step is to add a column to pg_aggregateso that all MIN/MAX aggregates can be handled. Per my recent proposal.
1 parentc3294f1 commitaddc42c

File tree

14 files changed

+980
-201
lines changed

14 files changed

+980
-201
lines changed

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

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
*
1010
*
1111
* IDENTIFICATION
12-
* $PostgreSQL: pgsql/src/backend/optimizer/path/indxpath.c,v 1.172 2005/03/28 00:58:22 tgl Exp $
12+
* $PostgreSQL: pgsql/src/backend/optimizer/path/indxpath.c,v 1.173 2005/04/11 23:06:55 tgl Exp $
1313
*
1414
*-------------------------------------------------------------------------
1515
*/
@@ -54,7 +54,6 @@
5454
((opclass) == BOOL_BTREE_OPS_OID || (opclass) == BOOL_HASH_OPS_OID)
5555

5656

57-
staticList*group_clauses_by_indexkey(IndexOptInfo*index);
5857
staticList*group_clauses_by_indexkey_for_join(Query*root,
5958
IndexOptInfo*index,
6059
Relidsouter_relids,
@@ -72,8 +71,6 @@ static bool pred_test_simple_clause(Expr *predicate, Node *clause);
7271
staticRelidsindexable_outerrelids(IndexOptInfo*index);
7372
staticPath*make_innerjoin_index_path(Query*root,IndexOptInfo*index,
7473
List*clausegroups);
75-
staticboolmatch_index_to_operand(Node*operand,intindexcol,
76-
IndexOptInfo*index);
7774
staticboolmatch_boolean_index_clause(Node*clause,intindexcol,
7875
IndexOptInfo*index);
7976
staticboolmatch_special_index_operator(Expr*clause,Oidopclass,
@@ -234,7 +231,7 @@ create_index_paths(Query *root, RelOptInfo *rel)
234231
* clauses matching column C, because the executor couldn't use them anyway.
235232
* Therefore, there are no empty sublists in the result.
236233
*/
237-
staticList*
234+
List*
238235
group_clauses_by_indexkey(IndexOptInfo*index)
239236
{
240237
List*clausegroup_list=NIL;
@@ -1774,7 +1771,7 @@ make_expr_from_indexclauses(List *indexclauses)
17741771
* indexcol: the column number of the index (counting from 0)
17751772
* index: the index of interest
17761773
*/
1777-
staticbool
1774+
bool
17781775
match_index_to_operand(Node*operand,
17791776
intindexcol,
17801777
IndexOptInfo*index)

‎src/backend/optimizer/plan/Makefile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,16 @@
44
# Makefile for optimizer/plan
55
#
66
# IDENTIFICATION
7-
# $PostgreSQL: pgsql/src/backend/optimizer/plan/Makefile,v 1.12 2003/11/29 19:51:50 pgsql Exp $
7+
# $PostgreSQL: pgsql/src/backend/optimizer/plan/Makefile,v 1.13 2005/04/11 23:06:55 tgl Exp $
88
#
99
#-------------------------------------------------------------------------
1010

1111
subdir = src/backend/optimizer/plan
1212
top_builddir = ../../../..
1313
include$(top_builddir)/src/Makefile.global
1414

15-
OBJS = createplan.o initsplan.o planmain.o planner.o setrefs.o subselect.o
15+
OBJS = createplan.o initsplan.o planagg.o planmain.o planner.o\
16+
setrefs.o subselect.o
1617

1718
all: SUBSYS.o
1819

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp