| От | rihad |
|---|---|
| Тема | Re: Would an index benefit select ... order by? |
| Дата | |
| Msg-id | 472D894A.3000500@mail.ru обсуждение исходный текст |
| Ответ на | Would an index benefit select ... order by? (rihad <rihad@mail.ru>) |
| Ответы |
Re: Would an index benefit select ... order by?
|
| Список | pgsql-general |
>> Should an index be used on a created_at timestamp column if you know you >> will be using "ORDER BY created_at ASC|DESC" from time to time? > > Yes. Thanks. This is stated explicitly in 8.3 docs (as opposed to 8.2) http://www.postgresql.org/docs/8.3/static/indexes-ordering.html > And you should use EXPLAIN. You mean Postgres wouldn't *always* use created_at's index with such access patterns on a big table (even if one exists): select * from foo order by created_at desc; ? Mind you the distribution of created_at values are going to be as different as the time is (i.e. almost as many different values as there are tables in the row).
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера