Re: partitioning and locking problems

From: Markus Schaber <schabi(at)logix-tt(dot)com>
To: Marc Morin <marc(at)sandvine(dot)com>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: partitioning and locking problems
Date: 2006-02-02 12:44:23
Message-ID: 43E1FEA7.8060509@logix-tt.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Hi, Marc,

Marc Morin wrote:

> 1- long running report is running on view
> 2- continuous inserters into view into a table via a rule
> 3- truncate or rule change occurs, taking an exclusive lock.
> Must wait for #1 to finish.
> 4- new reports and inserters must now wait for #3.
> 5- now everyone is waiting for a single query in #1. Results
> in loss of insert data granularity (important for our application).

Apart from having two separate views (one for report, one for insert) as
Richard suggested:

If you have fixed times for #3, don't start any #1 that won't finish
before it's time for #3.

You could also use the LOCK command on an empty lock table at the
beginning of each #1 or #3 transaction to prevent #3 from getting the
view lock before #1 is finished.

HTH,
Markus

--
Markus Schaber | Logical Tracking&Tracing International AG
Dipl. Inf. | Software Development GIS

Fight against software patents in EU! www.ffii.org www.nosoftwarepatents.org

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message tschak 2006-02-02 14:03:01 Index occupancy
Previous Message Markus Schaber 2006-02-02 12:14:55 Re: Where is my bottleneck?