Search Postgresql Archives

Re: update functions locking tables

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Clodoaldo Pinto <clodoaldo.pinto@xxxxxxxxx> writes:

> 2005/8/29, Tom Lane <tgl@xxxxxxxxxxxxx>:
> > 
> > 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


---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux