Re: [GENERAL] empty string causes planner to avoid index. Makes me sad.

2009-11-30 Thread Steve Crawford
Tom Lane wrote: Jeff Amiel writes: Ok...third try. The cost when passing in an empty string is SIGNIFICANTLY higher than when not. That just reflects the fact that it's expecting a lot more rows matching that query. I suppose this is because the statistics show you've got a lot mor

Re: [GENERAL] empty string causes planner to avoid index. Makes me sad.

2009-11-27 Thread Tom Lane
Jeff Amiel writes: > Ok...third try. The cost when passing in an empty string is SIGNIFICANTLY > higher than when not. That just reflects the fact that it's expecting a lot more rows matching that query. I suppose this is because the statistics show you've got a lot more rows containing the em

Re: [GENERAL] empty string causes planner to avoid index. Makes me sad.

2009-11-27 Thread Stephan Szabo
On Fri, 27 Nov 2009, Jeff Amiel wrote: > --- On Fri, 11/27/09, Tom Lane wrote: > > > You didn't show us any evidence of that, either.? Both > > of your test > > cases are using the index. > > Ok...third try. The cost when passing in an empty string is > SIGNIFICANTLY higher than when not. Would

Re: [GENERAL] empty string causes planner to avoid index. Makes me sad.

2009-11-27 Thread Guillaume Lelarge
Le vendredi 27 novembre 2009 à 23:32:14, Jeff Amiel a écrit : > --- On Fri, 11/27/09, Tom Lane wrote: > > You didn't show us any evidence of that, either. Both > > of your test > > cases are using the index. > > Ok...third try. The cost when passing in an empty string is SIGNIFICANTLY > higher

Re: [GENERAL] empty string causes planner to avoid index. Makes me sad.

2009-11-27 Thread Jeff Amiel
--- On Fri, 11/27/09, Tom Lane wrote: > You didn't show us any evidence of that, either.  Both > of your test > cases are using the index. Ok...third try. The cost when passing in an empty string is SIGNIFICANTLY higher than when not. Wouldn't seem that the planner is using the index effecti

Re: [GENERAL] empty string causes planner to avoid index. Makes me sad.

2009-11-27 Thread Tom Lane
Jeff Amiel writes: > hmm...ok...planner is not using the index effectively (as effectively as when > a non-empty value is passed in) You didn't show us any evidence of that, either. Both of your test cases are using the index. regards, tom lane -- Sent via pgsql-gener

Re: [GENERAL] empty string causes planner to avoid index. Makes me sad.

2009-11-27 Thread Jeff Amiel
hmm...ok...planner is not using the index effectively (as effectively as when a non-empty value is passed in) --- On Fri, 11/27/09, Tom Lane wrote: > From: Tom Lane > Subject: Re: [GENERAL] empty string causes planner to avoid index. Makes me > sad. > To: "Jeff Amiel"

Re: [GENERAL] empty string causes planner to avoid index. Makes me sad.

2009-11-27 Thread Tom Lane
Jeff Amiel writes: > It appears that somehow the empty string is causing the planner to abandon > the index. You didn't actually show us such a case... regards, tom lane -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subsc

[GENERAL] empty string causes planner to avoid index. Makes me sad.

2009-11-27 Thread Jeff Amiel
PostgreSQL 8.2.12 on i386-pc-solaris2.10, compiled by GCC gcc (GCC) 3.4.3 (csl-sol210-3_4-branch+sol_rpath) CREATE TABLE items ( field1 character(9) NOT NULL, field2 character varying(17) NOT NULL }; CREATE INDEX "field1-field2" ON items USING btree (field1, field2); About 15 million