Commit a0ea7133 authored by Tom Lane's avatar Tom Lane

Avoid rechecking lossy operators twice in a bitmap scan plan.

parent 1fcd4b7a
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/optimizer/plan/createplan.c,v 1.187 2005/04/25 03:58:30 tgl Exp $ * $PostgreSQL: pgsql/src/backend/optimizer/plan/createplan.c,v 1.188 2005/04/25 04:27:12 tgl Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -889,6 +889,14 @@ create_bitmap_scan_plan(Query *root, ...@@ -889,6 +889,14 @@ create_bitmap_scan_plan(Query *root,
/* Sort clauses into best execution order */ /* Sort clauses into best execution order */
qpqual = order_qual_clauses(root, qpqual); qpqual = order_qual_clauses(root, qpqual);
/*
* When dealing with special or lossy operators, we will at this point
* have duplicate clauses in qpqual and bitmapqualorig. We may as well
* drop 'em from bitmapqualorig, since there's no point in making the
* tests twice.
*/
bitmapqualorig = list_difference_ptr(bitmapqualorig, qpqual);
/* Finally ready to build the plan node */ /* Finally ready to build the plan node */
scan_plan = make_bitmap_heapscan(tlist, scan_plan = make_bitmap_heapscan(tlist,
qpqual, qpqual,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment