Skip to content

Commit a0ea713

Browse files
committed
Avoid rechecking lossy operators twice in a bitmap scan plan.
1 parent 1fcd4b7 commit a0ea713

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/backend/optimizer/plan/createplan.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
*
1111
*
1212
* IDENTIFICATION
13-
* $PostgreSQL: pgsql/src/backend/optimizer/plan/createplan.c,v 1.187 2005/04/25 03:58:30 tgl Exp $
13+
* $PostgreSQL: pgsql/src/backend/optimizer/plan/createplan.c,v 1.188 2005/04/25 04:27:12 tgl Exp $
1414
*
1515
*-------------------------------------------------------------------------
1616
*/
@@ -889,6 +889,14 @@ create_bitmap_scan_plan(Query *root,
889889
/* Sort clauses into best execution order */
890890
qpqual = order_qual_clauses(root, qpqual);
891891

892+
/*
893+
* When dealing with special or lossy operators, we will at this point
894+
* have duplicate clauses in qpqual and bitmapqualorig. We may as well
895+
* drop 'em from bitmapqualorig, since there's no point in making the
896+
* tests twice.
897+
*/
898+
bitmapqualorig = list_difference_ptr(bitmapqualorig, qpqual);
899+
892900
/* Finally ready to build the plan node */
893901
scan_plan = make_bitmap_heapscan(tlist,
894902
qpqual,

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy