Re: Decision support query inefficiencies ... - Mailing list pgsql-sql

From Tom Lane
Subject Re: Decision support query inefficiencies ...
Date
Msg-id 11828.1027975183@sss.pgh.pa.us
Whole thread Raw
In response to Decision support query inefficiencies ...  (Gunther Schadow <gunther@aurora.regenstrief.org>)
List pgsql-sql
Gunther Schadow <gunther@aurora.regenstrief.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


pgsql-sql by date:

Previous
From: Peter Atkins
Date:
Subject: Re: Returning PK of first insert for second insert use.
Next
From: "Patrick Hatcher"
Date:
Subject: Extremely slow query