Re: Decision support query inefficiencies ...

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Gunther Schadow <gunther(at)aurora(dot)regenstrief(dot)org>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: Decision support query inefficiencies ...
Date: 2002-07-29 20:39:43
Message-ID: 11828.1027975183@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Gunther Schadow <gunther(at)aurora(dot)regenstrief(dot)org> writes:
> A very frequent decision support query we have to make is to get the
> last act of a certain type that occurred before a certain cut-off
> date.

This seems pretty close to the type of problem DISTINCT ON is intended
to solve. Look at the "weather report" example in the SELECT reference
page.

regards, tom lane

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Patrick Hatcher 2002-07-29 23:32:57 Extremely slow query
Previous Message Peter Atkins 2002-07-29 20:20:01 Re: Returning PK of first insert for second insert use.