Re: How to speed up Exclusive Locking

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: David Goodenough <david(dot)goodenough(at)btconnect(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: How to speed up Exclusive Locking
Date: 2006-12-05 16:16:36
Message-ID: 5458.1165335396@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

David Goodenough <david(dot)goodenough(at)btconnect(dot)com> writes:
> The statements issued to lock each table is:-
> LOCK TABLE table IN EXCLUSIVE MODE; SELECT 1 FROM table;
> (I am not quite sure why the SELECT 1 FROM table is there, it came with
> HA-JDBC as the code for the Postgresql dialect).

> I notice that this seems to take a time that is dependant on the size
> of the table, which seems odd - almost as though it is locking each row
> rather than the whole table at once.

No, but it's *reading* each row to execute the "SELECT 1 FROM table".

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Bradley Russell 2006-12-05 16:44:28 Re: HELP: Urgent, Vacuum problem
Previous Message Bob Pawley 2006-12-05 15:55:35 Re: PG Admin