Received: from localhost (maia-1.hub.org [200.46.204.191]) by postgresql.org (Postfix) with ESMTP id C0BD69FBEF0 for ; Fri, 16 Mar 2007 13:18:15 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.191]) (amavisd-new, port 10024) with ESMTP id 16018-06 for ; Fri, 16 Mar 2007 13:18:01 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by postgresql.org (Postfix) with ESMTP id B1EEB9FBE7E for ; Fri, 16 Mar 2007 13:17:43 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.13.6/8.13.6) with ESMTP id l2GGHfSC007758; Fri, 16 Mar 2007 12:17:41 -0400 (EDT) To: "Travis Whitton" cc: pgsql-sql@postgresql.org Subject: Re: Grabbing Newest Records From Duplicates In-reply-to: References: <7240.1174059340@sss.pgh.pa.us> Comments: In-reply-to "Travis Whitton" message dated "Fri, 16 Mar 2007 10:55:33 -0500" Date: Fri, 16 Mar 2007 12:17:41 -0400 Message-ID: <7757.1174061861@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200703/232 X-Sequence-Number: 27870 "Travis Whitton" writes: > One last question, using the "weather report" example, is it going to > improve performance for the DISTINCT ON query to add an index to the > location and time columns? A two-column index matching the ORDER BY that you use might help, or then again might not --- for full-table scans it's often faster to sort than to try to use an index. regards, tom lane