| От | Ivar Zarans |
|---|---|
| Тема | Re: Slow UPADTE, compared to INSERT |
| Дата | |
| Msg-id | 20031204204326.GA17083@alcaron.ee обсуждение |
| Ответ на | Slow UPADTE, compared to INSERT (Ivar Zarans <iff@alcaron.ee>) |
| Список | pgsql-performance |
On Thu, Dec 04, 2003 at 08:23:36PM +0000, Richard Huxton wrote: > Ah - it's probably not the update but the IN. You can rewrite it using PG's > non-standard FROM: > > UPDATE t1 SET status='done' FROM t_tmp WHERE t1.rec_id = t_tmp.rec_id; Thanks for the hint. I'll try this. > Now that doesn't explain why the update is taking so long. One fifth of a > second is extremely slow. Are you certain that the index is being used? Explain shows following output: explain update table1 set status = 'PROC' where recid = '199901'; Index Scan using table1_pkey on table1 (cost=0.00..6.01 rows=1 width=198) Index Cond: (recid = 199901::bigint) (2 rows) -- Ivar Zarans
В списке pgsql-performance по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера