| От | K C Lau |
|---|---|
| Тема | Re: SELECT MIN, MAX took longer time than SELECT |
| Дата | |
| Msg-id | 6.2.1.2.0.20060121210512.08cc9310@localhost обсуждение исходный текст |
| Ответ на | Re: SELECT MIN, MAX took longer time than SELECT COUNT, MIN, MAX ("Jim C. Nasby" <jnasby@pervasive.com>) |
| Список | pgsql-performance |
At 01:20 06/01/21, Jim C. Nasby wrote:
>BTW, these queries below are meaningless; they are not equivalent to
>min(logsn).
>
> > esdt=> explain analyze select LogSN from Log where create_time <
> > '2005/10/19' order by create_time limit 1;
Thank you for pointing it out.
It actually returns the min(logsn), as the index is on (create_time,
logsn). To be more explicit, I have changed to query to:
explain analyze select LogSN from Log where create_time < '2005/10/19'
order by create_time, logsn limit 1;
esdt=> \d log;
create_time | character varying(23) | default
'1970/01/01~00:00:00.000'::character varying
logsn | integer | not null
...
Indexes:
"pk_log" PRIMARY KEY, btree (logsn)
"idx_logtime" btree (create_time, logsn)
Best regards,
KC.
В списке pgsql-performance по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера