pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Pavel Stehule <pavel.stehule@gmail.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
To: Bruce Momjian <bruce@momjian.us>
Cc: Marten Verhoeven <m.verhoeven@van-beek.nl>
Cc: pgsql-performance@postgresql.org
Subject: Re: Slow performance with left outer join
Date: Mon, 21 Jan 2008 19:04:33 +0100
Message-ID: <162867790801211004q3b01f0a3hb97d162392ac037@mail.gmail.com> (raw)
In-Reply-To: <8283.1200934555@sss.pgh.pa.us>
References: <D4E656958EEB52498883B7906D789CD54018EF@alpha2>
	<8283.1200934555@sss.pgh.pa.us>

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



view thread (4+ messages)

Message-ID: <162867790801211004q3b01f0a3hb97d162392ac037@mail.gmail.com>
Permalink:  ../162867790801211004q3b01f0a3hb97d162392ac037@mail.gmail.com/
Also on:    postgresql.org/message-id/162867790801211004q3b01f0a3hb97d162392ac037@mail.gmail.com

 · 

reply

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-performance@postgresql.org
  Cc: pavel.stehule@gmail.com, tgl@sss.pgh.pa.us, bruce@momjian.us, m.verhoeven@van-beek.nl
  Subject: Re: Slow performance with left outer join
  In-Reply-To: <162867790801211004q3b01f0a3hb97d162392ac037@mail.gmail.com>
  References: <D4E656958EEB52498883B7906D789CD54018EF@alpha2> <8283.1200934555@sss.pgh.pa.us> <162867790801211004q3b01f0a3hb97d162392ac037@mail.gmail.com>

* 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