| От | Bruno Wolff III |
|---|---|
| Тема | Re: Suggestion for aggregate function |
| Дата | |
| Msg-id | 20030117192901.GA3839@wolff.to обсуждение |
| Ответ на | Suggestion for aggregate function (Greg Stark <gsstark@mit.edu>) |
| Ответы |
Re: Suggestion for aggregate function
|
| Список | pgsql-hackers |
On Fri, Jan 17, 2003 at 13:39:11 -0500, Greg Stark <gsstark@mit.edu> wrote: > > So it would be possible to say for example: > > select min(column1),lookup_min(column1,column2) from tab > > to do the equivalent of: > > select column1,column2 where column1=(select min(column1) from tab) limit 1 > > except it would be way more efficient. (Especially if there's an index on > column1 and postgres were taught to use indexes for min/max, but that's a > different story.) The following will be more efficient than your function if there is a usable index on column1: select column1,column2 from tab order by column 1 limit 1
В списке pgsql-hackers по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера