limit order by performance issue

Поиск
Список
Период
Сортировка
От Pedro Jiménez
Тема limit order by performance issue
Дата
Msg-id 507C4B8E.3010806@ismsolar.com
обсуждение исходный текст
Ответы Re: limit order by performance issue  (Pavel Stehule <pavel.stehule@gmail.com>)
Re: limit order by performance issue  (Shaun Thomas <sthomas@optionshouse.com>)
Re: limit order by performance issue  (Karl Denninger <karl@denninger.net>)
Список pgsql-performance
Hello,
   I'm trying to do a simple SQL query over Postgresl 9.0 running on Ubuntu.

I have a large table (over 100 million records) with three fields,
id_signal (bigint), time_stamp (timestamp) and var_value (float).

My query looks like this:

select var_value from ism_floatvalues where id_signal = 29660 order by
time_stamp desc limit 1;

So I want to select the last value from a determinated ID (is_signal).

This query runs FOREVER, while if I delete "limit 1" it runs instantly....

Any help?

Regards.




В списке pgsql-performance по дате отправления:

Предыдущее
От: "Sam Wong"
Дата:
Сообщение: LIKE op with B-Tree Index?
Следующее
От: Pavel Stehule
Дата:
Сообщение: Re: limit order by performance issue