mirror of
https://github.com/postgres/postgres.git
synced 2025-10-27 00:12:01 +03:00
Create the planner mechanism for optimizing simple MIN and MAX queries
into indexscans on matching indexes. For the moment, it only handles int4 and text datatypes; next step is to add a column to pg_aggregate so that all MIN/MAX aggregates can be handled. Per my recent proposal.
This commit is contained in:
@@ -8,7 +8,7 @@
|
||||
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
|
||||
* Portions Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
* $PostgreSQL: pgsql/src/include/optimizer/paths.h,v 1.80 2005/03/27 06:29:49 tgl Exp $
|
||||
* $PostgreSQL: pgsql/src/include/optimizer/paths.h,v 1.81 2005/04/11 23:06:56 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -38,8 +38,11 @@ extern void debug_print_rel(Query *root, RelOptInfo *rel);
|
||||
extern void create_index_paths(Query *root, RelOptInfo *rel);
|
||||
extern Path *best_inner_indexscan(Query *root, RelOptInfo *rel,
|
||||
Relids outer_relids, JoinType jointype);
|
||||
extern List *group_clauses_by_indexkey(IndexOptInfo *index);
|
||||
extern List *group_clauses_by_indexkey_for_or(IndexOptInfo *index,
|
||||
Expr *orsubclause);
|
||||
extern bool match_index_to_operand(Node *operand, int indexcol,
|
||||
IndexOptInfo *index);
|
||||
extern List *expand_indexqual_conditions(IndexOptInfo *index,
|
||||
List *clausegroups);
|
||||
extern void check_partial_indexes(Query *root, RelOptInfo *rel);
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
|
||||
* Portions Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
* $PostgreSQL: pgsql/src/include/optimizer/planmain.h,v 1.80 2005/03/10 23:21:25 tgl Exp $
|
||||
* $PostgreSQL: pgsql/src/include/optimizer/planmain.h,v 1.81 2005/04/11 23:06:56 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -23,6 +23,12 @@
|
||||
extern void query_planner(Query *root, List *tlist, double tuple_fraction,
|
||||
Path **cheapest_path, Path **sorted_path);
|
||||
|
||||
/*
|
||||
* prototypes for plan/planagg.c
|
||||
*/
|
||||
extern Plan *optimize_minmax_aggregates(Query *root, List *tlist,
|
||||
Path *best_path);
|
||||
|
||||
/*
|
||||
* prototypes for plan/createplan.c
|
||||
*/
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
|
||||
* Portions Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
* $PostgreSQL: pgsql/src/include/optimizer/subselect.h,v 1.23 2004/12/31 22:03:36 pgsql Exp $
|
||||
* $PostgreSQL: pgsql/src/include/optimizer/subselect.h,v 1.24 2005/04/11 23:06:56 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -24,5 +24,7 @@ extern Node *convert_IN_to_join(Query *parse, SubLink *sublink);
|
||||
extern Node *SS_replace_correlation_vars(Node *expr);
|
||||
extern Node *SS_process_sublinks(Node *expr, bool isQual);
|
||||
extern void SS_finalize_plan(Plan *plan, List *rtable);
|
||||
extern Param *SS_make_initplan_from_plan(Query *root, Plan *plan,
|
||||
Oid resulttype, int32 resulttypmod);
|
||||
|
||||
#endif /* SUBSELECT_H */
|
||||
|
||||
Reference in New Issue
Block a user