pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: secret <secret@kearneydev.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: PG-SQL <pgsql-sql@postgreSQL.org>
Cc: John Ridout <johnridout@ctasystems.co.uk>
Subject: Re: [SQL] Good Optimization
Date: Mon, 19 Jul 1999 10:02:57 -0400
Message-ID: <37933011.CB0F3E76@kearneydev.com> (raw)
References: <26200.931362157@sss.pgh.pa.us>

Tom Lane wrote:

> secret <secret@kearneydev.com> writes:
> >     There is a simple way to optimize SQL queries involving joins to
> > PostgreSQL that I think should be handled by Postgre?  If one is joining
> > a tables a,b on attribute "x" and if one has something like x=3 then it
> > helps A LOT to say: a.x=3 and b.x=3 in addition to saying a.x=b.x ...
> > The example below shoulds the radical speed gain of doing this, and I
> > think it isn't something real obvious to most people...
>
> How much *actual* speedup is there?  I don't trust the optimizer's
> numbers as anything more than relative measures ;-)
>
> I'm a bit surprised that you are getting a nested-loop plan and not
> a merge or hash join.  With a merge join, at least, there ought not be
> a large difference from providing the additional qual clause (I think).
> What Postgres version are you using?
>
>                         regards, tom lane

    The actual performance difference is HUGE.  Hours vs minutes or Minutes vs
Seconds...

David Secret
MIS Director
Kearney Development Co., Inc.





view thread (27+ messages)  latest in thread

Message-ID: <37933011.CB0F3E76@kearneydev.com>
Permalink:  ../37933011.CB0F3E76@kearneydev.com/
Also on:    postgresql.org/message-id/37933011.CB0F3E76@kearneydev.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-sql@postgresql.org
  Cc: secret@kearneydev.com, tgl@sss.pgh.pa.us, johnridout@ctasystems.co.uk
  Subject: Re: [SQL] Good Optimization
  In-Reply-To: <37933011.CB0F3E76@kearneydev.com>
  References: <26200.931362157@sss.pgh.pa.us> <37933011.CB0F3E76@kearneydev.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