diff options
Diffstat (limited to 'src/backend/access/hash/hash.c')
-rw-r--r-- | src/backend/access/hash/hash.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/backend/access/hash/hash.c b/src/backend/access/hash/hash.c index cb82a38d901..ca0d6ec96dd 100644 --- a/src/backend/access/hash/hash.c +++ b/src/backend/access/hash/hash.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/access/hash/hash.c,v 1.85 2006/02/11 17:14:08 momjian Exp $ + * $PostgreSQL: pgsql/src/backend/access/hash/hash.c,v 1.86 2006/02/11 23:31:33 tgl Exp $ * * NOTES * This file contains only the public interface routines. @@ -517,6 +517,18 @@ hashbulkdelete(PG_FUNCTION_ARGS) cur_maxbucket = orig_maxbucket; loop_top: + + /* + * If we don't have anything to delete, skip the scan, and report the + * number of tuples shown in the metapage. (Unlike btree and gist, + * we can trust this number even for a partial index.) + */ + if (!callback_state) + { + cur_bucket = cur_maxbucket + 1; + num_index_tuples = local_metapage.hashm_ntuples; + } + while (cur_bucket <= cur_maxbucket) { BlockNumber bucket_blkno; |