Re: Grabbing Newest Records From Duplicates

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Travis Whitton" <tinymountain(at)gmail(dot)com>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: Grabbing Newest Records From Duplicates
Date: 2007-03-16 16:17:41
Message-ID: 7757.1174061861@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

"Travis Whitton" <tinymountain(at)gmail(dot)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

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Steve Crawford 2007-03-16 16:18:33 Re: log file permissions?
Previous Message Travis Whitton 2007-03-16 15:55:33 Re: Grabbing Newest Records From Duplicates