1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-03 20:02:46 +03:00

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.
This commit is contained in:
Tom Lane
2005-11-26 22:14:57 +00:00
parent a66e2c8885
commit da27c0a1ef
15 changed files with 378 additions and 147 deletions

View File

@ -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;
pathnode->tidquals = tidquals;
cost_tidscan(&pathnode->path, root, rel, tideval);
/*
* divide selectivity for each clause to get an equal selectivity as
* IndexScan does OK ?
*/
cost_tidscan(&pathnode->path, root, rel, tidquals);
return pathnode;
}