Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Wf2g2-0005zW-G7 for pgsql-bugs@arkaria.postgresql.org; Tue, 29 Apr 2014 07:42:06 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1Wf2g1-00009Y-RX for pgsql-bugs@arkaria.postgresql.org; Tue, 29 Apr 2014 07:42:05 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Wf2g1-00009S-4v for pgsql-bugs@postgresql.org; Tue, 29 Apr 2014 07:42:05 +0000 Received: from wrigleys.postgresql.org ([204.145.124.246]) by magus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Wf2fy-00073j-K6 for pgsql-bugs@postgresql.org; Tue, 29 Apr 2014 07:42:04 +0000 MIME-Version: 1.0 Subject: BUG #10171: Specific prepared statement cannot use bitmapOr index scan since 9.2 To: pgsql-bugs@postgresql.org From: pilum.70@uni-muenster.de Date: Tue, 29 Apr 2014 07:41:55 +0000 Message-ID: <20140429074155.2644.29021@wrigleys.postgresql.org> X-Pg-Spam-Score: -1.9 (-) Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org The following bug has been logged on the website: Bug reference: 10171 Logged by: Arnold Scheffler Email address: pilum.70@uni-muenster.de PostgreSQL version: 9.3.4 Operating system: CentOS 5/6, enough memory Description: Migrating WebCMS Imperia to PostgreSQL 9.3 revealed a significant Performance Decrease (query took 4s instead of .4 ms) The following query uses bitmap or index scan in 9.1, but only Nested Loop in 9.2 and 9.3: Steps to reproduce without Imperia CMS and with simplified query: create table t1 as select generate_series as id1, chr( cast( ceil(74*RANDOM()+48) as integer)) ||chr( cast( ceil(74*RANDOM()+48) as integer)) ||chr( cast( ceil(74*RANDOM()+48) as integer)) ||chr( cast( ceil(74*RANDOM()+48) as integer)) ||chr( cast( ceil(74*RANDOM()+48) as integer)) ||chr( cast( ceil(74*RANDOM()+48) as integer)) ||chr( cast( ceil(74*RANDOM()+48) as integer)) as id2 from generate_series(1,100000); create table t2 as select generate_series as id1, chr( cast( ceil(74*RANDOM()+48) as integer)) ||chr( cast( ceil(74*RANDOM()+48) as integer)) ||chr( cast( ceil(74*RANDOM()+48) as integer)) ||chr( cast( ceil(74*RANDOM()+48) as integer)) ||chr( cast( ceil(74*RANDOM()+48) as integer)) ||chr( cast( ceil(74*RANDOM()+48) as integer)) ||chr( cast( ceil(74*RANDOM()+48) as integer)) as id2 from generate_series(1,200); create unique index id11_idx on t1(id1); create unique index id12_idx on t1(id2); create unique index id21_idx on t2(id1); create unique index id22_idx on t2(id2); prepare slowquery as SELECT t1.id1, t2.id1 FROM t1 JOIN t2 ON (t1.id2, t2.id2) IN (($1, $2), ($3, $4)); explain analyze execute slowquery('','',NULL,NULL); -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs