pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Diego de Lima <diego@sistemica.info>
To: pgsql-performance@postgresql.org
Subject: LEFT JOIN ON vs. LEFT JOIN USING performance
Date: Fri, 19 Aug 2005 12:22:35 -0300
Message-ID: <002a01c5a4d1$d36f6420$3dc8a8c0@diretoria02> (raw)

Hi list,

I´m using Pg 8.0.3 on Linux FC2.

This question may have a very simple answer (I hope), but I´m having lots of trouble solving it, and I counldn´t find any other post about it or anything in the pg docs.

I have some very complex select statements on 4 million rows tables. When using LEFT JOIN ON, some select statements takes about 2 minutes. When I write exactly the same statement but with LEFT JOIN USING, it takes only 1 minute. Comparing to Oracle, the same statement takes 1 minute also, but with LEFT JOIN ON.

Sometimes tables have the same column names and I can use LEFT JOIN USING, but in some other cases I MUST use LEFT JOIN ON, because the tables have different column names.

So my question is: is there a way to make LEFT JOIN ON uses the same plan of LEFT JOIN USING?

Thanks,

Diego de Lima

view thread (3+ messages)  latest in thread

Message-ID: <002a01c5a4d1$d36f6420$3dc8a8c0@diretoria02>
Permalink:  ../002a01c5a4d1$d36f6420$3dc8a8c0@diretoria02/
Also on:    postgresql.org/message-id/002a01c5a4d1$d36f6420$3dc8a8c0@diretoria02

 · 

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 using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: diego@sistemica.info
  Subject: Re: LEFT JOIN ON vs. LEFT JOIN USING performance
  In-Reply-To: <002a01c5a4d1$d36f6420$3dc8a8c0@diretoria02>

* 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