diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 1999-07-27 03:51:11 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 1999-07-27 03:51:11 +0000 |
commit | 9e7e29e6c9dd386a56ab23f419bc358f630cf768 (patch) | |
tree | 43859920134e180b991a001e35173a8a715da440 /src/include/optimizer | |
parent | 434df3fb7a545637610f02c5491be1d6ce81069f (diff) |
First cut at doing LIKE/regex indexing optimization in
optimizer rather than parser. This has many advantages, such as not
getting fooled by chance uses of operator names ~ and ~~ (the operators
are identified by OID now), and not creating useless comparison operations
in contexts where the comparisons will not actually be used as indexquals.
The new code also recognizes exact-match LIKE and regex patterns, and
produces an = indexqual instead of >= and <=.
This change does NOT fix the problem with non-ASCII locales: the code
still doesn't know how to generate an upper bound indexqual for non-ASCII
collation order. But it's no worse than before, just the same deficiency
in a different place...
Also, dike out loc_restrictinfo fields in Plan nodes. These were doing
nothing useful in the absence of 'expensive functions' optimization,
and they took a considerable amount of processing to fill in.
Diffstat (limited to 'src/include/optimizer')
-rw-r--r-- | src/include/optimizer/clauses.h | 3 | ||||
-rw-r--r-- | src/include/optimizer/paths.h | 3 |
2 files changed, 4 insertions, 2 deletions
diff --git a/src/include/optimizer/clauses.h b/src/include/optimizer/clauses.h index 748c0d46e9f..ad6976760a5 100644 --- a/src/include/optimizer/clauses.h +++ b/src/include/optimizer/clauses.h @@ -6,7 +6,7 @@ * * Copyright (c) 1994, Regents of the University of California * - * $Id: clauses.h,v 1.23 1999/07/25 23:07:23 tgl Exp $ + * $Id: clauses.h,v 1.24 1999/07/27 03:51:00 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -35,6 +35,7 @@ extern Expr *get_notclausearg(Expr *notclause); extern bool and_clause(Node *clause); extern Expr *make_andclause(List *andclauses); extern Expr *make_ands_explicit(List *andclauses); +extern List *make_ands_implicit(Expr *clause); extern bool case_clause(Node *clause); diff --git a/src/include/optimizer/paths.h b/src/include/optimizer/paths.h index a26085d05e2..75d9e328458 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.31 1999/07/15 15:21:22 momjian Exp $ + * $Id: paths.h,v 1.32 1999/07/27 03:51:01 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -28,6 +28,7 @@ extern RelOptInfo *make_one_rel(Query *root, List *rels); extern List *create_index_paths(Query *root, RelOptInfo *rel, List *indices, List *restrictinfo_list, List *joininfo_list); +extern List *expand_indexqual_conditions(List *indexquals); /* * joinpath.h |