diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2005-11-26 22:14:57 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2005-11-26 22:14:57 +0000 |
commit | da27c0a1ef9c35afef18f7ae3542498cb3a943a9 (patch) | |
tree | b97eff1d7aed83a69499436fe4bc08eb37a3c1a8 /src/backend/optimizer/util/pathnode.c | |
parent | a66e2c88855a8c290149d03cfcd6c6a2a5dc53fe (diff) |
Teach tid-scan code to make use of "ctid = ANY (array)" clauses, so that
"ctid IN (list)" will still work after we convert IN to ScalarArrayOpExpr.
Make some minor efficiency improvements while at it, such as ensuring that
multiple TIDs are fetched in physical heap order. And fix EXPLAIN so that
it shows what's really going on for a TID scan.
Diffstat (limited to 'src/backend/optimizer/util/pathnode.c')
-rw-r--r-- | src/backend/optimizer/util/pathnode.c | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/src/backend/optimizer/util/pathnode.c b/src/backend/optimizer/util/pathnode.c index 934daf8b28f..624cf506a35 100644 --- a/src/backend/optimizer/util/pathnode.c +++ b/src/backend/optimizer/util/pathnode.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/optimizer/util/pathnode.c,v 1.125 2005/10/15 02:49:21 momjian Exp $ + * $PostgreSQL: pgsql/src/backend/optimizer/util/pathnode.c,v 1.126 2005/11/26 22:14:57 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -613,11 +613,10 @@ create_bitmap_or_path(PlannerInfo *root, /* * create_tidscan_path - * Creates a path corresponding to a tid_direct scan, returning the - * pathnode. + * Creates a path corresponding to a scan by TID, returning the pathnode. */ TidPath * -create_tidscan_path(PlannerInfo *root, RelOptInfo *rel, List *tideval) +create_tidscan_path(PlannerInfo *root, RelOptInfo *rel, List *tidquals) { TidPath *pathnode = makeNode(TidPath); @@ -625,14 +624,9 @@ create_tidscan_path(PlannerInfo *root, RelOptInfo *rel, List *tideval) pathnode->path.parent = rel; pathnode->path.pathkeys = NIL; - pathnode->tideval = tideval; - - cost_tidscan(&pathnode->path, root, rel, tideval); + pathnode->tidquals = tidquals; - /* - * divide selectivity for each clause to get an equal selectivity as - * IndexScan does OK ? - */ + cost_tidscan(&pathnode->path, root, rel, tidquals); return pathnode; } |