diff options
Diffstat (limited to 'src/include')
| -rw-r--r-- | src/include/nodes/bitmapset.h | 5 | ||||
| -rw-r--r-- | src/include/nodes/relation.h | 12 | ||||
| -rw-r--r-- | src/include/utils/hsearch.h | 4 |
3 files changed, 18 insertions, 3 deletions
diff --git a/src/include/nodes/bitmapset.h b/src/include/nodes/bitmapset.h index 2ba017fc2ee..b831c4e59a1 100644 --- a/src/include/nodes/bitmapset.h +++ b/src/include/nodes/bitmapset.h @@ -13,7 +13,7 @@ * * Copyright (c) 2003-2005, PostgreSQL Global Development Group * - * $PostgreSQL: pgsql/src/include/nodes/bitmapset.h,v 1.6 2005/01/01 20:44:28 tgl Exp $ + * $PostgreSQL: pgsql/src/include/nodes/bitmapset.h,v 1.7 2005/06/08 23:02:05 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -80,4 +80,7 @@ extern Bitmapset *bms_join(Bitmapset *a, Bitmapset *b); /* support for iterating through the integer elements of a set: */ extern int bms_first_member(Bitmapset *a); +/* support for hashtables using Bitmapsets as keys: */ +extern uint32 bms_hash_value(const Bitmapset *a); + #endif /* BITMAPSET_H */ diff --git a/src/include/nodes/relation.h b/src/include/nodes/relation.h index 93dc78aece4..7c702f7105a 100644 --- a/src/include/nodes/relation.h +++ b/src/include/nodes/relation.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $PostgreSQL: pgsql/src/include/nodes/relation.h,v 1.111 2005/06/06 04:13:36 tgl Exp $ + * $PostgreSQL: pgsql/src/include/nodes/relation.h,v 1.112 2005/06/08 23:02:05 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -72,7 +72,17 @@ typedef struct PlannerInfo struct RelOptInfo **base_rel_array; /* All one-relation RelOptInfos */ int base_rel_array_size; /* current allocated array len */ + /* + * join_rel_list is a list of all join-relation RelOptInfos we have + * considered in this planning run. For small problems we just scan + * the list to do lookups, but when there are many join relations we + * build a hash table for faster lookups. The hash table is present + * and valid when join_rel_hash is not NULL. Note that we still maintain + * the list even when using the hash table for lookups; this simplifies + * life for GEQO. + */ List *join_rel_list; /* list of join-relation RelOptInfos */ + struct HTAB *join_rel_hash; /* optional hashtable for join relations */ List *equi_key_list; /* list of lists of equijoined * PathKeyItems */ diff --git a/src/include/utils/hsearch.h b/src/include/utils/hsearch.h index bb93dea0775..881327a3e03 100644 --- a/src/include/utils/hsearch.h +++ b/src/include/utils/hsearch.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $PostgreSQL: pgsql/src/include/utils/hsearch.h,v 1.36 2005/05/29 04:23:06 tgl Exp $ + * $PostgreSQL: pgsql/src/include/utils/hsearch.h,v 1.37 2005/06/08 23:02:05 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -184,5 +184,7 @@ extern long hash_select_dirsize(long num_entries); extern uint32 string_hash(const void *key, Size keysize); extern uint32 tag_hash(const void *key, Size keysize); extern uint32 oid_hash(const void *key, Size keysize); +extern uint32 bitmap_hash(const void *key, Size keysize); +extern int bitmap_match(const void *key1, const void *key2, Size keysize); #endif /* HSEARCH_H */ |
