| От | Adam Rich |
|---|---|
| Тема | Re: UPDATE... FROM - will ORDER BY not respected? |
| Дата | |
| Msg-id | 49F766F8.6030402@sbcglobal.net обсуждение исходный текст |
| Ответ на | Re: UPDATE... FROM - will ORDER BY not respected? ("Carlo Stonebanks" <stonec.register@sympatico.ca>) |
| Список | pgsql-general |
Carlo Stonebanks wrote: >> I think the ORDER BY is free to update the rows in any order it needs >> to. The key is to put the sequence further down. How about this? > > Adam - thanks. Unless I hear otherwise I will assume that you mean the > UPDATE is free to update the rows in any way it wants - irregardless of > how whether the data return in the FROM clause is ordered. > Whoops - you're right, that's what I meant. Even though one of the tables is sorted, when it joins the two tables, the planner might decide it's cheaper to update impt_table by iteratively looking up values from the sorted table that match the (unordered) rows from impt_table, or by hashing the keys which I think also results in unsorted updates. You can use "explain" to see the details. Adam
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера