Re: limit order by performance issue - Mailing list pgsql-performance

From Marti Raudsepp
Subject Re: limit order by performance issue
Date
Msg-id CABRT9RAKSdwRUE6PrCg6XV=xXi8U2Nyx9Q0YK_ob=yQ2DXuGRw@mail.gmail.com
Whole thread Raw
In response to Re: limit order by performance issue  (Karl Denninger <karl@denninger.net>)
List pgsql-performance
On Tue, Oct 16, 2012 at 10:47 PM, Karl Denninger <karl@denninger.net> wrote:
> Put an index on time_stamp (I assume there is one on id_signal already)

Well the optimal index for this particular query would include both columns:
(id_signal, time_stamp) -- in this order.

Additionally, if you want to take advantage of the index-only scans
feature, add the SELECTed column too:
(id_signal, time_stamp, var_value)

Regards,
Marti


pgsql-performance by date:

Previous
From: Merlin Moncure
Date:
Subject: Re: LIKE op with B-Tree Index?
Next
From: Chris Ruprecht
Date:
Subject: Have: Seq Scan - Want: Index Scan - what am I doing wrong?