« first day (3 days earlier)    last day (15 days later) » 

9:10 AM
3
A: Fetch a row that contains the set of last non-NULL values for each column

Erwin Brandstetterfirst() aggregate function This table is not going to be huge as in this will be a couple of thousand rows only. So, not worried very much about performance. I suppose the custom aggregate function first() will be the simplest solution, then. Install the custom aggregate function first() as ins...

How can our functions have a good performance without a descending index? — Gerard H. Pille yesterday
@GerardH.Pille: Postgres can read a B-tree index backwards at almost the same speed. (But special considerations apply to multicolumn indices. See: dba.stackexchange.com/a/39599/3684) — Erwin Brandstetter yesterday
 

« first day (3 days earlier)    last day (15 days later) »