pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Travis Whitton <tinymountain@gmail.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: Grabbing Newest Records From Duplicates
Date: Fri, 16 Mar 2007 12:17:41 -0400
Message-ID: <7757.1174061861@sss.pgh.pa.us> (raw)
In-Reply-To: <cf9b4f3e0703160855q537eafe6yf3c3bbea090e5b6e@mail.gmail.com>
References: <cf9b4f3e0703160828s2cc0b9v6c01db6e8634e37e@mail.gmail.com>
	<7240.1174059340@sss.pgh.pa.us>
	<cf9b4f3e0703160855q537eafe6yf3c3bbea090e5b6e@mail.gmail.com>

"Travis Whitton" <tinymountain@gmail.com> 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



view thread (4+ messages)

Message-ID: <7757.1174061861@sss.pgh.pa.us>
Permalink:  ../7757.1174061861@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/7757.1174061861@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: tgl@sss.pgh.pa.us, tinymountain@gmail.com
  Subject: Re: Grabbing Newest Records From Duplicates
  In-Reply-To: <7757.1174061861@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox