X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id A2052D1B4E6 for ; Sun, 9 Nov 2003 02:38:28 +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 88811-04 for ; Sat, 8 Nov 2003 22:38:01 -0400 (AST) Received: from megazone.bigpanda.com (megazone.bigpanda.com [64.147.171.210]) by svr1.postgresql.org (Postfix) with ESMTP id D9190D1B4F2 for ; Sat, 8 Nov 2003 22:37:56 -0400 (AST) Received: by megazone.bigpanda.com (Postfix, from userid 1001) id A129235360; Sat, 8 Nov 2003 18:37:45 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by megazone.bigpanda.com (Postfix) with ESMTP id 9FFED35223; Sat, 8 Nov 2003 18:37:45 -0800 (PST) Date: Sat, 8 Nov 2003 18:37:45 -0800 (PST) From: Stephan Szabo To: ow Cc: pgsql-sql@postgresql.org Subject: Re: pg 7.4.rc1, Range query performance In-Reply-To: <20031109021012.65828.qmail@web21401.mail.yahoo.com> Message-ID: <20031108183630.I51201@megazone.bigpanda.com> References: <20031109021012.65828.qmail@web21401.mail.yahoo.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200311/66 X-Sequence-Number: 15881 On Sat, 8 Nov 2003, ow wrote: > Postgresql 7.4.rc1 on i686 pc linux compiled by gcc 2.06. > All configuration settings are default. > > > Hi, > > Trying to find a way to improve range query performance. > > The table Test has about 30 million records. > > -- DLong, Dtimestamp, Dint, etc are domains of the respective types. > create table Test ( > id DLong not null, > a Dtimestamp null, > b Dint not null, > c Dint not null, > d Dstring null, > constraint PK_id primary key (id), > constraint AK_abc unique (a, b, c) > ); I'm not sure that AK_abc is the best index for check a range on a and single values on b and c. I'd think that something like an index on (b,c,a) would probably be better for this purpose (without doing any testing ;) ).