Re: [GENERAL] Query is not using index when it should
В списке pgsql-performance по дате отправления:
| От | Steinar H. Gunderson |
|---|---|
| Тема | Re: [GENERAL] Query is not using index when it should |
| Дата | |
| Msg-id | 20041211143213.GA2659@uio.no обсуждение исходный текст |
| Ответ на | Re: [GENERAL] Query is not using index when it should (tomas@nocrew.org (Tomas Skäre)) |
| Ответы |
Re: [GENERAL] Query is not using index when it should
Re: [GENERAL] Query is not using index when it should |
| Список | pgsql-performance |
On Sat, Dec 11, 2004 at 03:17:13PM +0100, Tomas Skäre wrote: > select c.* from cjm_object c > inner join > (select max(timestamp) as timestamp,objectid,field from cjm_object > group by objectid,field) t > using(timestamp,objectid,field) > where 1=1 and data is not null > order by objectid,field; Usually, SELECT max(field) FROM table is better written in PostgreSQL as SELECT field FROM table ORDER field DESC LIMIT 1. I don't see the point of "where 1=1", though... /* Steinar */ -- Homepage: http://www.sesse.net/
В списке pgsql-performance по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера