fastes way to retrieve segmented without using loop

Поиск
Список
Период
Сортировка
От Tom Smith
Тема fastes way to retrieve segmented without using loop
Дата
Msg-id CAKwSVFHtiS8oSjTJGvswX-VTakeZAQd5DJYkkktorCFCAuwYUg@mail.gmail.com
обсуждение исходный текст
Ответы Re: fastes way to retrieve segmented without using loop
Re: fastes way to retrieve segmented without using loop
Список pgsql-general
Hello:

I have a time series table,
using below sql, loop (psque code), I can get one row for each hour

for( H=1: H< 99999; H++){
   select  * from table where  t >= H and t < H+1   limit 1
}

t (time column) is indexed).

Is there a better way to use a issue a SINGLE SQL
with  an array of time start/end pair
so it will be executed once to send back result, which would be much faster
than issuing sql again and again (even with prepared statement and using sql function).

Thanks in Advance

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

Предыдущее
От: Igor Sosa Mayor
Дата:
Сообщение: Re: Problem with pl/python procedure connecting to the internet
Следующее
От: Melvin Davidson
Дата:
Сообщение: Re: fastes way to retrieve segmented without using loop