Re: Slow performance with left outer join

From: "Pavel Stehule" <pavel(dot)stehule(at)gmail(dot)com>
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "Bruce Momjian" <bruce(at)momjian(dot)us>
Cc: "Marten Verhoeven" <m(dot)verhoeven(at)van-beek(dot)nl>, pgsql-performance(at)postgresql(dot)org
Subject: Re: Slow performance with left outer join
Date: 2008-01-21 18:04:33
Message-ID: 162867790801211004q3b01f0a3hb97d162392ac037@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Hello

> > Filter: ((COALESCE((at_type)::integer, 1) = 1) AND (COALESCE(at_language, 0::numeric) = 0::numeric))
>
> If this is slow, it must be that the scan of fpuarticletext actually
> returns many more rows than the single row the planner is expecting.
> The reason the estimate is off is probably that the planner cannot make
> any useful estimate about those COALESCE expressions. Try rewriting
> them in the simpler forms
>
> (at_type = 1 or at_type is null) AND
> (at_language = 0 or at_language is null)
>

what about put this topic into FAQ.

Regards
Pavel Stehule

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Decibel! 2008-01-21 19:29:52 Re: strange pauses
Previous Message Tom Lane 2008-01-21 16:55:55 Re: Slow performance with left outer join