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

Replace planner's representation of relation sets, per pghackers discussion.

Instead of Lists of integers, we now store variable-length bitmap sets.
This should be faster as well as less error-prone.
This commit is contained in:
Tom Lane
2003-02-08 20:20:55 +00:00
parent 893678eda7
commit c15a4c2aef
35 changed files with 1453 additions and 626 deletions

View File

@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/allpaths.c,v 1.95 2003/01/25 23:10:27 tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/allpaths.c,v 1.96 2003/02/08 20:20:54 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@ -79,7 +79,7 @@ make_one_rel(Query *root)
/*
* The result should join all the query's base rels.
*/
Assert(length(rel->relids) == length(root->base_rel_list));
Assert(bms_num_members(rel->relids) == length(root->base_rel_list));
return rel;
}
@ -98,12 +98,11 @@ set_base_rel_pathlists(Query *root)
foreach(rellist, root->base_rel_list)
{
RelOptInfo *rel = (RelOptInfo *) lfirst(rellist);
Index rti;
Index rti = rel->relid;
RangeTblEntry *rte;
List *inheritlist;
Assert(length(rel->relids) == 1); /* better be base rel */
rti = lfirsti(rel->relids);
Assert(rti > 0); /* better be base rel */
rte = rt_fetch(rti, root->rtable);
if (rel->rtekind == RTE_SUBQUERY)
@ -696,14 +695,19 @@ recurse_push_qual(Node *setOp, Query *topquery,
static void
print_relids(Relids relids)
{
List *l;
Relids tmprelids;
int x;
bool first = true;
foreach(l, relids)
tmprelids = bms_copy(relids);
while ((x = bms_first_member(tmprelids)) >= 0)
{
printf("%d", lfirsti(l));
if (lnext(l))
if (!first)
printf(" ");
printf("%d", x);
first = false;
}
bms_free(tmprelids);
}
static void