Re: Avoid huge perfomance loss on string concatenation - Mailing list pgsql-general

From Martijn van Oosterhout
Subject Re: Avoid huge perfomance loss on string concatenation
Date
Msg-id 20071206172444.GA17812@svana.org
Whole thread Raw
In response to Re: Avoid huge perfomance loss on string concatenation  ("Andrus" <kobruleht2@hot.ee>)
List pgsql-general
On Wed, Dec 05, 2007 at 11:32:59AM +0200, Andrus wrote:
> I do'nt have this index.
> dok.kuupaev||dok.kellaaeg conditon should applied after index search is
> performed.
> It filters out only a small number of rows additionally to the plain kuupaev
> filter.
> So adding index on dok.kuupaev||dok.kellaaeg  is not reasonable IMHO.

Your problem is that it is doing that, except postgres is assuming that
it does filter more rows. In actual fact the extra condition is making
no difference whatsoever.

So postgres assumes the result will only give 10 rows and so a nested
loop is better.

As for the index problem, I don't know but it will probably work better.

Have a nice day,
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> Those who make peaceful revolution impossible will make violent revolution inevitable.
>  -- John F Kennedy

Attachment

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: Nested loop in simple query taking long time
Next
From: SHARMILA JOTHIRAJAH
Date:
Subject: record-based log shipping