X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 7C60AD1B58D for ; Thu, 30 Oct 2003 16:11:44 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 80963-06 for ; Thu, 30 Oct 2003 12:11:13 -0400 (AST) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by svr1.postgresql.org (Postfix) with ESMTP id EFB2DD1B561 for ; Thu, 30 Oct 2003 12:11:12 -0400 (AST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.12.10/8.12.10) with ESMTP id h9UGBCit028552; Thu, 30 Oct 2003 11:11:12 -0500 (EST) To: Rajesh Kumar Mallah Cc: pgsql-performance@postgresql.org Subject: Re: Query puts 7.3.4 on endless loop but 7.4beta5 is fine. [ with better indenting ] In-reply-to: <200310301702.00275.mallah@trade-india.com> References: <33298.203.145.130.142.1067457626.squirrel@mail.trade-india.com> <20031029202920.GZ7337@pallas.fsck.com> <33402.203.145.130.142.1067460429.squirrel@mail.trade-india.com> <200310301702.00275.mallah@trade-india.com> Comments: In-reply-to Rajesh Kumar Mallah message dated "Thu, 30 Oct 2003 17:02:00 +0530" Date: Thu, 30 Oct 2003 11:11:12 -0500 Message-ID: <28551.1067530272@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200310/762 X-Sequence-Number: 4510 Rajesh Kumar Mallah writes: > SELECT DISTINCT main.* FROM > ( > ( > ( > ( > Tickets main JOIN Groups as Groups_1 ON ( main.id = Groups_1.Instance) > ) JOIN > Principals as Principals_2 ON ( Groups_1.id = Principals_2.ObjectId) > ) JOIN > CachedGroupMembers as CachedGroupMembers_3 ON ( Principals_2.id = CachedGroupMembers_3.GroupId) > ) JOIN > Users as Users_4 ON ( CachedGroupMembers_3.MemberId = Users_4.id) > ) WHERE > ... I think the reason for the performance difference is that 7.3 treats JOIN syntax as forcing a particular join order, while 7.4 doesn't. regards, tom lane