pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Koen Antonissen <koen@v3.com>
To: pgsql-sql@postgresql.org
Subject: Join performance
Date: Tue, 5 Dec 2000 10:42:09 +0100
Message-ID: <BBEPKLBOJENIHNEGNKLFGEMMCBAA.koen@v3.com> (raw)
In-Reply-To: <20001205022029.62885.qmail@web10401.mail.yahoo.com>

Hi there,

I'm having some problems with the performance on queries including a join.

for example:
SELECT members_data.pwd FROM emails,members_data WHERE emails.email =
'koen@v3.com' AND emails.uin = members_data.uin;

is a lot slower then extracting the join into 2 seperate queries like:

SELECT emails.uin FROM emails WHERE lower(emails.email) = 'koen@v3.com';

--and use the result in the next query ($db_result)

SELECT members_data.pwd FROM members_data WHERE members_data.uin =
$db_result;

Now the login routine is MUCH faster ;-) , but performance problems remain
when the the result is more than 1 record (Unlike a unique emailaddress...)

Is there anyone out there who has ideas how to write faster queries
including tablejoins?

I already tried Inner Join, Natural Join and Join On, wich didn't seem
affect the performance in any way...

Kind regards,
Koen Antonissen
koen@trilab.com
www.trilab.com




view thread (12+ messages)  latest in thread

Message-ID: <BBEPKLBOJENIHNEGNKLFGEMMCBAA.koen@v3.com>
Permalink:  ../BBEPKLBOJENIHNEGNKLFGEMMCBAA.koen@v3.com/
Also on:    postgresql.org/message-id/BBEPKLBOJENIHNEGNKLFGEMMCBAA.koen@v3.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 using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: koen@v3.com
  Subject: Re: Join performance
  In-Reply-To: <BBEPKLBOJENIHNEGNKLFGEMMCBAA.koen@v3.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