X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id B314AD1DA57 for ; Thu, 28 Aug 2003 14:44:21 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 26183-03 for ; Thu, 28 Aug 2003 11:43:46 -0300 (ADT) Received: from smtp.pspl.co.in (unknown [202.54.11.65]) by svr1.postgresql.org (Postfix) with ESMTP id E6411D1DA4D for ; Thu, 28 Aug 2003 11:43:39 -0300 (ADT) Received: (from root@localhost) by smtp.pspl.co.in (8.12.9/8.12.9) id h7SEmHTx012387 for ; Thu, 28 Aug 2003 20:18:17 +0530 Received: from daithan (daithan.intranet.pspl.co.in [192.168.7.161]) (authenticated bits=0) by persistent.co.in (8.12.9/8.12.9) with ESMTP id h7SEmGhi012374 for ; Thu, 28 Aug 2003 20:18:16 +0530 From: "Shridhar Daithankar" To: pgsql-performance@postgresql.org Date: Thu, 28 Aug 2003 20:15:40 +0530 MIME-Version: 1.0 Subject: Re: Simple queries take forever to run Reply-To: shridhar_daithankar@persistent.co.in Message-ID: <3F4E62EC.15091.71172C@localhost> In-reply-to: <3F4E13CF.7080202@rentec.com> References: <20030827182051.W85397-100000@megazone.bigpanda.com> X-mailer: Pegasus Mail for Windows (v4.12a) Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7BIT Content-description: Mail message body X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/416 X-Sequence-Number: 3232 On 28 Aug 2003 at 10:38, Michael Guerin wrote: > >IN(subquery) is known to run poorly in 7.3.x and earlier. 7.4 is > >generally much better (for reasonably sized subqueries) but in earlier > >versions you'll probably want to convert into an EXISTS or join form. > Something else seems to be going on, even switching to an exists clause > gives much better but poor performance. > count(*) where exists clause: Postgresql 19s, SQL Server <1s > count(*) where not exists: 23.3s SQL Server 1.5s This was with 7.4? Can you try downloading 7.4CVS and try? > > SQL Server runs on a dual 1.4 with 4gigs, win2k > Postgresql runs on a quad 900 with 8 gigs, sunos 5.8 SunOS...Not the impala out there but anyways I would refrain from slipping in that.. Parden me if this is a repeatation, have you set your effective cache size? Bye Shridhar -- Nouvelle cuisine, n.: French for "not enough food".Continental breakfast, n.: English for "not enough food".Tapas, n.: Spanish for "not enough food".Dim Sum, n.: Chinese for more food than you've ever seen in your entire life.