From: blove319@hotmail.com
To: pgsql-bugs@postgresql.org
Subject: BUG #6719: PG shouldn't filter on same criteria as index search
Date: Thu, 05 Jul 2012 18:19:39 +0000
Message-ID: <E1SmqeR-0000x3-RI@wrigleys.postgresql.org> (raw)
The following bug has been logged on the website:
Bug reference: 6719
Logged by: BLove
Email address: blove319@hotmail.com
PostgreSQL version: 9.1.3
Operating system: Centos 5
Description:
After doing an equality search on an indexed field, PG is doing a filter on
the same value using a regex. That appears to be a useless operation that
will only consume cpu cycles.
explain select * from transactions.subscriber_504700_txns_y2012m05 lh where
lh.account_code LIKE '34016975\_DAT\_FR\_HF';
QUERY PLAN
----------------------------------------------------------------------------------------------------------------------------------------------
Index Scan using idx_subscriber_504700_txns_y2012m05_account_code on
subscriber_504700_txns_y2012m05 lh (cost=0.00..17.02 rows=3 width=131)
Index Cond: (account_code = '34016975_DAT_FR_HF'::text)
Filter: (account_code ~~ '34016975\_DAT\_FR\_HF'::text)
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: blove319@hotmail.com
Subject: Re: BUG #6719: PG shouldn't filter on same criteria as index search
In-Reply-To: <E1SmqeR-0000x3-RI@wrigleys.postgresql.org>
References: <E1SmqeR-0000x3-RI@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