From: Tom Lane <tgl@sss.pgh.pa.us>
To: Richard Yen <dba@richyen.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: query plan with index having a btrim is different for strings of different length
Date: Tue, 09 Dec 2008 18:27:23 -0500
Message-ID: <22937.1228865243@sss.pgh.pa.us> (raw)
In-Reply-To: <751F49DC-1142-4E9C-95C8-BC3C229B3F0B@richyen.com>
References: <751F49DC-1142-4E9C-95C8-BC3C229B3F0B@richyen.com>
Richard Yen <dba@richyen.com> writes:
> I've discovered a peculiarity with using btrim in an index and was
> wondering if anyone has any input.
What PG version is this?
In particular, I'm wondering if it's one of the early 8.2.x releases,
which had some bugs in and around choose_bitmap_and() that caused
them to sometimes make weird choices of indexes in a BitmapAnd plan
structure ...
Like David, I'm pretty dubious that the behavior has anything to do with
strings being 5 characters long exactly; but it could very much depend
on whether the string you choose is a common last name or not. That
would change the estimated number of matching rows and hence affect the
apparent relative attractiveness of different indexes.
regards, tom lane
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 using the --to and --cc options:
reply via email
To: pgsql-performance@postgresql.org
Cc: tgl@sss.pgh.pa.us, dba@richyen.com
Subject: Re: query plan with index having a btrim is different for strings of different length
In-Reply-To: <22937.1228865243@sss.pgh.pa.us>
* 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