From: | Craig Ringer <ringerc(at)ringerc(dot)id(dot)au> |
---|---|
To: | Albe Laurenz <laurenz(dot)albe(at)wien(dot)gv(dot)at> |
Cc: | Akash Kodibail *EXTERN* <akash(dot)kodibail(at)onmobile(dot)com>, pgsql-admin(at)postgresql(dot)org |
Subject: | Re: Delay in completion of aggregation inserts when run in a single commit - PG 9.1.2 |
Date: | 2012-07-05 12:22:47 |
Message-ID: | 4FF58717.2000901@ringerc.id.au |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-admin |
On 07/05/2012 04:00 PM, Albe Laurenz wrote:
> Akash Kodibail wrote:
>> Problem:
> [...]
>> - Aggregation process almost never completes which is a set of 15
> insert queries. Entire
>> process happens in a single commit (population of staging tables and
> aggregation).
>> - When I run these 15 queries individually, it happens in no time.
>>
>> Could you be kind enough to explain how differently queries run when
> in a "single commit" as opposed
>> to running each of them individually?
> Apart from minor differences (current_timestamp, ...) the
> main difference is that there is no COMMIT after each query.
> COMMIT is expensive since it requires a write to hard disk.
>
> Try to get the execution plans of the queries in both cases
> and see if you can spot a difference.
Actually, that's a thought. Autovaccum can't see uncomitted work, and
thus can't analyze it. Maybe they need an explicit ANALYZE or two after
a bulk insert or update during their data load.
--
Craig Ringer
From | Date | Subject | |
---|---|---|---|
Next Message | Isabella Ghiurea | 2012-07-05 14:55:39 | Re: auto vacuum errors |
Previous Message | Albe Laurenz | 2012-07-05 08:00:08 | Re: Delay in completion of aggregation inserts when run in a single commit - PG 9.1.2 |