From: pilum.70@uni-muenster.de
To: pgsql-bugs@postgresql.org
Subject: BUG #10171: Specific prepared statement cannot use bitmapOr index scan since 9.2
Date: Tue, 29 Apr 2014 07:41:55 +0000
Message-ID: <20140429074155.2644.29021@wrigleys.postgresql.org> (raw)
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-bugs@postgresql.org
Cc: pilum.70@uni-muenster.de
Subject: Re: BUG #10171: Specific prepared statement cannot use bitmapOr index scan since 9.2
In-Reply-To: <20140429074155.2644.29021@wrigleys.postgresql.org>
References: <20140429074155.2644.29021@wrigleys.postgresql.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox