X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (neptune.hub.org [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 041EBD1B47D for ; Sat, 20 Dec 2003 17:02:26 +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 97651-04 for ; Sat, 20 Dec 2003 13:01:36 -0400 (AST) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by svr1.postgresql.org (Postfix) with ESMTP id 62662D1B469 for ; Sat, 20 Dec 2003 13:01:35 -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 hBKH1I19017156; Sat, 20 Dec 2003 12:01:18 -0500 (EST) To: Ray Ontko Cc: "A.Bhuvaneswaran" , pgsql-admin@postgresql.org Subject: Re: Index is not used In-reply-to: <20031220144752.GA30502@ontko.com> References: <1071894514.1380.1.camel@Bhuvan.bksys.co.in> <14302.1071895143@sss.pgh.pa.us> <1071900746.1380.57.camel@Bhuvan.bksys.co.in> <20031220144752.GA30502@ontko.com> Comments: In-reply-to Ray Ontko message dated "Sat, 20 Dec 2003 09:47:52 -0500" Date: Sat, 20 Dec 2003 12:01:18 -0500 Message-ID: <17155.1071939678@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200312/290 X-Sequence-Number: 11796 Ray Ontko writes: > BTW, Are you sure that you need to do the "distinct"? That's a good question to ask. > If you do, > then you might try putting the order_date column first in the > select list. The distinct is requiring that all the rows be sorted > so that they can be uniqified. I'm hoping that by putting order_date > first in the that the sort will have to do less work to put them in > order. (Anyone know if this will actually help?) I don't believe it will help much if at all. Increasing sort_mem might help, though. regards, tom lane