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 1F3E4D1B914 for ; Thu, 28 Aug 2003 01:27:02 +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 97916-07 for ; Wed, 27 Aug 2003 22:26:34 -0300 (ADT) Received: from houston.familyhealth.com.au (unknown [203.59.48.253]) by svr1.postgresql.org (Postfix) with ESMTP id 0DA28D1B8AB for ; Wed, 27 Aug 2003 22:26:29 -0300 (ADT) Received: from mars (work-40.internal [192.168.0.40]) by houston.familyhealth.com.au (8.12.9/8.12.9) with SMTP id h7S1QWLt012958; Thu, 28 Aug 2003 09:26:32 +0800 (WST) (envelope-from chriskl@familyhealth.com.au) Message-ID: <010101c36d03$c2dae240$2800a8c0@mars> From: "Christopher Kings-Lynne" To: "Michael Guerin" , References: <3F4D2535.8050103@rentec.com> Subject: Re: Simple queries take forever to run Date: Thu, 28 Aug 2003 09:29:01 +0800 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/368 X-Sequence-Number: 3184 > postgresql version 7.3.3 > .conf params changed from defaults. > shared_buffers = 64000 > sort_mem = 64000 > fsync = false > effective_cache_size = 400000 > > ex. query: select * from x where id in (select id from y); > > There's an index on each table for id. SQL Server takes <1s to return, > postgresql doesn't return at all, neither does explain analyze. > x has 1200673 rows > y has 1282 rows > > It seems like its ignoring the index and not using enough memory.. any > ideas? This is a known problem in 7.3, it is much faster in 7.4b1. This should be very, very fast though, and do exactly the same thing: select * from x where exists (select id from y where y.id=x.id); Chris