summaryrefslogtreecommitdiff
path: root/src/backend/optimizer/path/indxpath.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>1999-07-25 23:07:26 +0000
committerTom Lane <tgl@sss.pgh.pa.us>1999-07-25 23:07:26 +0000
commit49ed4dd77910f5993e5c4100bf0ca48f893a898e (patch)
treea8f923e9d594714cf392c81f9e05f4fbd10789bf /src/backend/optimizer/path/indxpath.c
parent8ae29a1d40749a69b760aeab1f67a1265c234b8e (diff)
Further work on planning of indexscans. Cleaned up interfaces
to index_selectivity so that it can be handed an indexqual clause list rather than a bunch of assorted derivative data.
Diffstat (limited to 'src/backend/optimizer/path/indxpath.c')
-rw-r--r--src/backend/optimizer/path/indxpath.c41
1 files changed, 18 insertions, 23 deletions
diff --git a/src/backend/optimizer/path/indxpath.c b/src/backend/optimizer/path/indxpath.c
index 62996ee7d4c..2f1002c78f5 100644
--- a/src/backend/optimizer/path/indxpath.c
+++ b/src/backend/optimizer/path/indxpath.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/optimizer/path/indxpath.c,v 1.64 1999/07/25 17:53:27 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/backend/optimizer/path/indxpath.c,v 1.65 1999/07/25 23:07:24 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -1216,25 +1216,20 @@ index_innerjoin(Query *root, RelOptInfo *rel, RelOptInfo *index,
{
List *clausegroup = lfirst(i);
IndexPath *pathnode = makeNode(IndexPath);
- Cost temp_selec;
- float temp_pages;
- List *attnos,
- *values,
- *flags;
-
- get_joinvars(lfirsti(rel->relids), clausegroup,
- &attnos, &values, &flags);
- index_selectivity(lfirsti(index->relids),
- index->classlist,
- get_opnos(clausegroup),
- getrelid(lfirsti(rel->relids),
- root->rtable),
- attnos,
- values,
- flags,
- length(clausegroup),
- &temp_pages,
- &temp_selec);
+ List *indexquals;
+ float npages;
+ float selec;
+
+ indexquals = get_actual_clauses(clausegroup);
+
+ index_selectivity(root,
+ lfirsti(rel->relids),
+ lfirsti(index->relids),
+ indexquals,
+ &npages,
+ &selec);
+
+ /* XXX this code ought to be merged with create_index_path */
pathnode->path.pathtype = T_IndexScan;
pathnode->path.parent = rel;
@@ -1249,14 +1244,14 @@ index_innerjoin(Query *root, RelOptInfo *rel, RelOptInfo *index,
*/
pathnode->indexid = index->relids;
pathnode->indexkeys = index->indexkeys;
- pathnode->indexqual = lcons(get_actual_clauses(clausegroup), NIL);
+ pathnode->indexqual = lcons(indexquals, NIL);
/* joinid saves the rels needed on the outer side of the join */
pathnode->path.joinid = lfirst(outerrelids_list);
pathnode->path.path_cost = cost_index((Oid) lfirsti(index->relids),
- (int) temp_pages,
- temp_selec,
+ (int) npages,
+ selec,
rel->pages,
rel->tuples,
index->pages,