Re: update functions locking tables
| От | Greg Stark |
|---|---|
| Тема | Re: update functions locking tables |
| Дата | |
| Msg-id | 87fysr4lk4.fsf@stark.xeocode.com обсуждение исходный текст |
| Ответ на | Re: update functions locking tables (Clodoaldo Pinto <clodoaldo.pinto@gmail.com>) |
| Ответы |
Re: update functions locking tables
|
| Список | pgsql-general |
Clodoaldo Pinto <clodoaldo.pinto@gmail.com> writes: > 2005/8/29, Tom Lane <tgl@sss.pgh.pa.us>: > > > > What is the function doing to the table, exactly? DDL changes generally > > take exclusive locks ... > > This is the transaction: > > begin; > select update_last_date(); > truncate times_producao; I think truncate takes a table lock. Just change it to "delete from times_producao". Also, if consider doing a "vacuum full" or "cluster" after the batch job to clear up the free space (not in a large transaction). That will still take a table lock but it may be a small enough downtime to be worth the speed increase the rest of the day. -- greg
В списке pgsql-general по дате отправления: