Received: from gate.v3.com (gate.v3.com [213.156.3.162]) by mail.postgresql.org (8.11.1/8.11.1) with ESMTP id eB59eUG18640 for ; Tue, 5 Dec 2000 04:40:30 -0500 (EST) (envelope-from koen@v3.com) Received: from trilabkoen (unknown [192.168.0.70]) by gate.v3.com (Postfix) with SMTP id 6D88E5D24 for ; Tue, 5 Dec 2000 10:45:20 +0100 (CET) From: "Koen Antonissen" To: Subject: Join performance Date: Tue, 5 Dec 2000 10:42:09 +0100 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0) X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6700 Importance: Normal In-Reply-To: <20001205022029.62885.qmail@web10401.mail.yahoo.com> X-Archive-Number: 200012/31 X-Sequence-Number: 362 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