| От | Poul Jensen |
|---|---|
| Тема | Add serial in specific order? |
| Дата | |
| Msg-id | 45191B7B.2080401@gfy.ku.dk обсуждение исходный текст |
| Ответы |
Re: Add serial in specific order?
|
| Список | pgsql-general |
I have ~25 columns in my database and need to order the rows by all columns to do queries like: SELECT a FROM table ORDER BY a, b, c, ...., z; I suspect it would be highly ineffective to order by all columns for every query! Hence I'd like to do the ordering only once and add a serial to the database specifying the order so all subsequent queries can be done like: SELECT b FROM table ORDER BY added_serial; The optimal ordering is found from analysis of the database and is not known at build time. Is it possible to add the serial without having to rebuild the database? It has millions of rows, by the way... Thanks for any advice. Poul Jensen
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера