| От | nolan@celery.tssi.com |
|---|---|
| Тема | Re: table alias on update, another update question |
| Дата | |
| Msg-id | 20030624163330.6557.qmail@celery.tssi.com обсуждение исходный текст |
| Ответ на | Re: table alias on update, another update question (Bruno Wolff III <bruno@wolff.to>) |
| Список | pgsql-general |
> I think something like the following is best. I rewrote the max and min > functions in a way that will work well if there is a combined index on > t2_key and t2_col1 as well as t2_key and t2_col2. Another approach would > be to join to a group by select from table2. There may be some circumstances > where that gives you better performance, but I can't think of a particular > circumstance where that is likely offhand. I hadn't thought of using LIMIT in that context, a nice trick to remember! That worked fairly well even with an index just on the keys. It took about the same time as just loading the data from the first record in each key group. -- Mike Nolan
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера