looking to speed up SELECT ... LEFT JOIN query - Mailing list pgsql-general

From ta145@yahoo.com (Trey Ackerman)
Subject looking to speed up SELECT ... LEFT JOIN query
Date
Msg-id 1b23bd38.0208062103.3ec45a2b@posting.google.com
Whole thread Raw
Responses Re: looking to speed up SELECT ... LEFT JOIN query  (Richard Huxton <dev@archonet.com>)
List pgsql-general
Hi,

I have a working SELECT statement using LEFT JOIN but I'm hoping
someone can suggest something that might be a bit quicker (currently 3
seconds for result).

SELECT * FROM ((table1 LEFT JOIN table2 USING (custno)) AS j1
         LEFT JOIN table3 USING (custno)) AS j2
         LEFT JOIN table4 USING (custno)
         WHERE custno='$custno';

The primary table is table1, the key for all tables is 'custno'.  I
need the LEFT JOIN because any one or all of the other tables (table2,
table3, table4) might not have corresponding data.

Regards,

Trey Ackerman

pgsql-general by date:

Previous
From: "Joel Joseph"
Date:
Subject: working with arrays question
Next
From: jfo123@hotmail.com (Axier)
Date:
Subject: Re: PostgreSQL + PHP 4.2x buggy with Apache?