On Tue, Oct 16, 2012 at 10:47 PM, Karl Denninger <karl@xxxxxxxxxxxxx> 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 -- Sent via pgsql-performance mailing list (pgsql-performance@xxxxxxxxxxxxxx) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-performance