pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: sarloc@jevic.com
To: pgsql-sql@postgresql.org
Subject: Poor performance on a right join
Date: 13 Mar 2003 16:12:31 -0800
Message-ID: <c8ae6a4.0303131612.270f150a@posting.google.com> (raw)

When doing a join query I am getting a responce time of 3 seconds. The
callhist table has 66000 rows and the phone table has 10000 rows. I
have an indexes on callhist.call_date, callhist.operator_id,
phone.phone, & phone.cust_code. Here's the SQL
SELECT a.CALL_DATE, a.OPERATOR_ID, a.CUST_CODE FROM PHONE as b right
join CALLHIST as a on (a.CUST_CODE=b.CUST_CODE) where (b.PHONE =
'555-555-5555') order by a.call_date desc;
The postgres db is running on a 2 P3 700 processor server with 1GB of
ram running Red Hat Linux 7.3. I am running PostgreSQL 7.2.2

Why is the query taking so long? What can I do to help the
performance?

Thanks in advance,

Carmen



view thread (6+ messages)  latest in thread

Message-ID: <c8ae6a4.0303131612.270f150a@posting.google.com>
Permalink:  ../c8ae6a4.0303131612.270f150a@posting.google.com/
Also on:    postgresql.org/message-id/c8ae6a4.0303131612.270f150a@posting.google.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: sarloc@jevic.com
  Subject: Re: Poor performance on a right join
  In-Reply-To: <c8ae6a4.0303131612.270f150a@posting.google.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