diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 1999-08-21 03:49:17 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 1999-08-21 03:49:17 +0000 |
commit | db436adf761bd5cb7990745ceba2959ac4bfca7c (patch) | |
tree | 8878ce970fd9b3ac480f3c5ef953fbc85827e685 /src/include/optimizer/paths.h | |
parent | 5588c559e6e21fae6ba1f162616f4fb4f680fb31 (diff) | |
download | postgresql-db436adf761bd5cb7990745ceba2959ac4bfca7c.tar.gz postgresql-db436adf761bd5cb7990745ceba2959ac4bfca7c.zip |
Major revision of sort-node handling: push knowledge of query
sort order down into planner, instead of handling it only at the very top
level of the planner. This fixes many things. An explicit sort is now
avoided if there is a cheaper alternative (typically an indexscan) not
only for ORDER BY, but also for the internal sort of GROUP BY. It works
even when there is no other reason (such as a WHERE condition) to consider
the indexscan. It works for indexes on functions. It works for indexes
on functions, backwards. It's just so cool...
CAUTION: I have changed the representation of SortClause nodes, therefore
THIS UPDATE BREAKS STORED RULES. You will need to initdb.
Diffstat (limited to 'src/include/optimizer/paths.h')
-rw-r--r-- | src/include/optimizer/paths.h | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/include/optimizer/paths.h b/src/include/optimizer/paths.h index b0ec64c3e32..58da94368c9 100644 --- a/src/include/optimizer/paths.h +++ b/src/include/optimizer/paths.h @@ -7,7 +7,7 @@ * * Copyright (c) 1994, Regents of the University of California * - * $Id: paths.h,v 1.34 1999/08/16 02:17:45 tgl Exp $ + * $Id: paths.h,v 1.35 1999/08/21 03:49:15 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -56,11 +56,15 @@ typedef enum extern PathKeysComparison compare_pathkeys(List *keys1, List *keys2); extern bool pathkeys_contained_in(List *keys1, List *keys2); -extern Path *get_cheapest_path_for_pathkeys(List *paths, List *pathkeys); +extern Path *get_cheapest_path_for_pathkeys(List *paths, List *pathkeys, + bool indexpaths_only); extern List *build_index_pathkeys(Query *root, RelOptInfo *rel, RelOptInfo *index); extern List *build_join_pathkeys(List *outer_pathkeys, List *join_rel_tlist, List *joinclauses); +extern bool commute_pathkeys(List *pathkeys); +extern List *make_pathkeys_for_sortclauses(List *sortclauses, + List *tlist); extern List *find_mergeclauses_for_pathkeys(List *pathkeys, List *restrictinfos); extern List *make_pathkeys_for_mergeclauses(List *mergeclauses, |