| От | Tom Lane |
|---|---|
| Тема | Re: Performance Implications of Using Exceptions |
| Дата | |
| Msg-id | 20193.1207024175@sss.pgh.pa.us обсуждение исходный текст |
| Ответ на | Re: Performance Implications of Using Exceptions ("Robins Tharakan" <tharakan@gmail.com>) |
| Список | pgsql-performance |
"Robins Tharakan" <tharakan@gmail.com> writes:
> Would it fine to consider that an UPDATE query that found no records to
> update is (performance wise) the same as a SELECT query with the same WHERE
> clause ?
> As in, does an UPDATE query perform additional overhead even before it finds
> the record to work on ?
The UPDATE would fire BEFORE STATEMENT and AFTER STATEMENT triggers, if
there are any. Also, it would take a slightly stronger lock on the
table, which might result in blocking either the UPDATE itself or some
concurrent query where a plain SELECT would not've.
There might be some other corner cases I've forgotten. But in the basic
case I think your assumption is correct.
regards, tom lane
В списке pgsql-performance по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера