Skip site navigation (1) Skip section navigation (2)

Re: query plan with index having a btrim is different for strings of different length

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Richard Yen <dba(at)richyen(dot)com>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: query plan with index having a btrim is different for strings of different length
Date: 2008-12-09 23:27:23
Message-ID: 22937.1228865243@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-performance
Richard Yen <dba(at)richyen(dot)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

In response to

Responses

pgsql-performance by date

Next:From: Scott CareyDate: 2008-12-09 23:34:49
Subject: Re: Need help with 8.4 Performance Testing
Previous:From: justinDate: 2008-12-09 23:19:35
Subject: Re: Need help with 8.4 Performance Testing

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group