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

Re: Join optimisation Quandry

From: Ceri Storey <cez(at)necrofish(dot)org(dot)uk>
To: Stephan Szabo <sszabo(at)megazone(dot)bigpanda(dot)com>
Cc: Ceri Storey <cez(at)necrofish(dot)org(dot)uk>,pgsql-performance(at)postgresql(dot)org
Subject: Re: Join optimisation Quandry
Date: 2004-01-17 10:40:49
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-performance
On Fri, Jan 16, 2004 at 10:05:54PM -0800, Stephan Szabo wrote:
> Well the plan would seems reasonable to me if there really was only 1 row
> coming from the where conditions on p1.  As a first step, if you raise the
> statistics target (see ALTER TABLE) for prog_start and prog_stop and
> re-analyze the table, do you get a better estimate of the rows from that
> condition? 

Indeed, that helps a fair bit with the estimate.

> Secondly, what do you get if you enable_nestloop=off before
> explain analyzing the query?
See attachment.

Saying that, I've managed to halve the query time by lifting the join of
the title out of the RHS of the left outer join into the top-level of
the FROM clause; which was really the kind of advice I was after. If
this is the wrong list for that kind of thing, please say so.

Again, thanks.
Ceri Storey <cez(at)necrofish(dot)org(dot)uk>

In response to

pgsql-performance by date

Next:From: Ceri StoreyDate: 2004-01-17 11:58:26
Subject: Re: Join optimisation Quandry
Previous:From: Stephan SzaboDate: 2004-01-17 06:05:54
Subject: Re: Join optimisation Quandry

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