summaryrefslogtreecommitdiff
path: root/src/backend/nodes/tidbitmap.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2005-08-28 22:47:20 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2005-08-28 22:47:20 +0000
commit46a0eee3006b11a15b73426c8146ed5ab32e1d62 (patch)
tree84e646e836446437c7fd310fd0aaf167b561e4dc /src/backend/nodes/tidbitmap.c
parent75e90bbf69efb3cee8d3af9c07d345dd9540a7cc (diff)
Tweak nodeBitmapAnd to stop evaluating sub-plan scans if it finds it's
got an empty bitmap after any step; the remaining subplans can no longer affect the result. Per a suggestion from Ilia Kantor.
Diffstat (limited to 'src/backend/nodes/tidbitmap.c')
-rw-r--r--src/backend/nodes/tidbitmap.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/backend/nodes/tidbitmap.c b/src/backend/nodes/tidbitmap.c
index 777bf6482d2..e36a8d9806a 100644
--- a/src/backend/nodes/tidbitmap.c
+++ b/src/backend/nodes/tidbitmap.c
@@ -23,7 +23,7 @@
* Copyright (c) 2003-2005, PostgreSQL Global Development Group
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/nodes/tidbitmap.c,v 1.5 2005/07/24 02:25:26 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/nodes/tidbitmap.c,v 1.6 2005/08/28 22:47:20 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -511,6 +511,15 @@ tbm_intersect_page(TIDBitmap *a, PagetableEntry *apage, const TIDBitmap *b)
}
/*
+ * tbm_is_empty - is a TIDBitmap completely empty?
+ */
+bool
+tbm_is_empty(const TIDBitmap *tbm)
+{
+ return (tbm->nentries == 0);
+}
+
+/*
* tbm_begin_iterate - prepare to iterate through a TIDBitmap
*
* NB: after this is called, it is no longer allowed to modify the contents