Re: table alias on update, another update question - Mailing list pgsql-general

From nolan@celery.tssi.com
Subject Re: table alias on update, another update question
Date
Msg-id 20030624163330.6557.qmail@celery.tssi.com
Whole thread Raw
In response to Re: table alias on update, another update question  (Bruno Wolff III <bruno@wolff.to>)
List pgsql-general
> I think something like the following is best. I rewrote the max and min
> functions in a way that will work well if there is a combined index on
> t2_key and t2_col1 as well as t2_key and t2_col2. Another approach would
> be to join to a group by select from table2. There may be some circumstances
> where that gives you better performance, but I can't think of a particular
> circumstance where that is likely offhand.

I hadn't thought of using LIMIT in that context, a nice trick to remember!

That worked fairly well even with an index just on the keys.  It took
about the same time as just loading the data from the first record in
each key group.
--
Mike Nolan

pgsql-general by date:

Previous
From: "Reuben D. Budiardja"
Date:
Subject: Re: [pgsql-advocacy] Documentation quality WAS: interesting
Next
From: Bruno Wolff III
Date:
Subject: Re: Selecting dupes from table