| От | Josh Berkus |
|---|---|
| Тема | Re: order by x DESC, y ASC indexing problem |
| Дата | |
| Msg-id | web-1771021@davinci.ethosmedia.com обсуждение исходный текст |
| Ответ на | order by x DESC, y ASC indexing problem (Vincent-Olivier Arsenault <vincent@up4c.com>) |
| Ответы |
Re: order by x DESC, y ASC indexing problem
|
| Список | pgsql-sql |
Vincent, > SELECT * FROM TABLE1 ORDER BY X DESC, Y ASC; > > (X is a date and Y a varchar) > > What would that index be? > > Is there a function I can use, to invert x (the date), so that I can > make a query / index set like : PostgreSQL's sorting mechanism can use an index either ascending or descending; it does not make a difference. However, most of the time ORDER BY does not use an index at all because a seq scan is faster. Usually, ORDER BY uses an index only when combined with related criteria and/or the LIMIT clause. -Josh Berkus
В списке pgsql-sql по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера