mirror of
https://github.com/postgres/postgres.git
synced 2025-07-28 23:42:10 +03:00
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.
This commit is contained in:
@ -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 $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -510,6 +510,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
|
||||
*
|
||||
|
Reference in New Issue
Block a user