Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id 3F36FB5DC15 for ; Mon, 27 Jun 2011 12:02:18 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 65142-02-7 for ; Mon, 27 Jun 2011 15:02:11 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-iw0-f174.google.com (mail-iw0-f174.google.com [209.85.214.174]) by mail.postgresql.org (Postfix) with ESMTP id 399CFB5DBCE for ; Mon, 27 Jun 2011 12:01:38 -0300 (ADT) Received: by iwn6 with SMTP id 6so4155220iwn.19 for ; Mon, 27 Jun 2011 08:01:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=ge04hCZakfuklqNwAxT/W/TRWQEO9TQ7IC6D7MLZzfE=; b=xN1C4Aaq+OFvYQLvjFpURVBZoBYMMb++nDGNMaEfTMbrGoWpUzG4AYpZMnc7ZL3++L xtWWPXH4uKpXGZL4crDdR73LcfCfYCCSzIu/gtX2M2PLH3rt6ebF1TMAVKchIeZeofax 1tZ5WmdpKwQRbpYfY5AKXTy7wL7fUgXEDdJLk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=uUpru2YzVbuGCJ37mmMS/k/VfBRQaMnsTm+n/49aVfroyRCPPOQrbVFVoFjms/zEW/ UdGWBllQy97JHAkNMucbhosbb9jc8nijJas5AgoOQR3wvKyLmQHqI3QdZvRB9T6tSFkP WN4zb1u9vKujjjshlnHbJUSIRKSbfpxlGB8kk= MIME-Version: 1.0 Received: by 10.231.82.131 with SMTP id b3mr6326014ibl.2.1309186897080; Mon, 27 Jun 2011 08:01:37 -0700 (PDT) Received: by 10.231.30.73 with HTTP; Mon, 27 Jun 2011 08:01:37 -0700 (PDT) In-Reply-To: <4E084F71020000250003EC59@gw.wicourts.gov> References: <4E084F71020000250003EC59@gw.wicourts.gov> Date: Mon, 27 Jun 2011 18:01:37 +0300 Message-ID: Subject: Re: Performance issue with Insert From: Jenish To: Kevin Grittner Cc: pgsql-performance@postgresql.org Content-Type: multipart/alternative; boundary=000e0cd6b306f1f2b504a6b2d3ff X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.898 tagged_above=-10 required=5 tests=BAYES_00=-1.9, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001 X-Spam-Level: X-Archive-Number: 201106/243 X-Sequence-Number: 44176 --000e0cd6b306f1f2b504a6b2d3ff Content-Type: text/plain; charset=ISO-8859-1 Hi, DB : POSTGRES 8.4.8 OS : Debian HD : SAS 10k rpm Shared_buffer is 4096 25 % of RAM , effective_cache is 8GB 75% of RAM After insert trigger is again calling 2 more trigger and insert record in another table depends on condition. with all trigger enable there are 8 insert and 32 updates(approx. update is depends on hierarchy) Plz explain multiple connections. Current scenario application server is sending all requests. -- Thanks & regards, JENISH VYAS On Mon, Jun 27, 2011 at 5:37 PM, Kevin Grittner wrote: > Jenish wrote: > > > I am using postgres 8.4.x > > With x being what? On what OS and hardware? > > > Table is having 3 before insert trigger and one after insert > > trigger. > > > > With all triggers enable it is inserting only 4-5 record per > > second. > > > > But if I disable after insert trigger it is able to insert 667 > > records per second. > > http://wiki.postgresql.org/wiki/SlowQueryQuestions > > > After insert trigger is recursive trigger. > > So are you counting only the top level inserts or also the ones > generated by the recursive inserts? > > > My question. > > > > How to avoid the bottleneck? > > First you need to find out what the bottleneck is. > > > Parallel processing is possible in Postgres? How? > > To achieve parallel processing in PostgreSQL you need to use > multiple connections. > > -Kevin > --000e0cd6b306f1f2b504a6b2d3ff Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hi,

DB : POSTGRES 8.4.8
OS =A0: Debian
HD : SAS 10k rpm

Shared_buffer is 4096 25 % of = RAM , effective_cache is 8GB 75% of RAM

After inse= rt trigger is again calling 2 more trigger and insert record in another tab= le depends on condition.

with all trigger enable there are 8 insert and 32 updat= es(approx. update is depends on=A0hierarchy)

Plz e= xplain=A0multiple connections. Current scenario application server is sendi= ng all requests.

--=A0
Thanks & regards,
JENI= SH VYAS

On Mon, Jun 27, 2011 at 5:37 PM, Kevin Grittner &l= t;Kevin.Grittner@wicourts.go= v> wrote:
Jenish <jenishvyas@gmail.com> wrote:

> I am using postgres 8.4.x

With x being what? =A0On what OS and hardware?

> Table is having 3 before insert trigger and one after insert
> trigger.
>
> With all triggers enable it is inserting only 4-5 record per
> second.
>
> But if I disable after insert trigger it is able to insert 667
> records per second.

http://wiki.postgresql.org/wiki/SlowQueryQuestions

> After insert trigger is recursive trigger.

So are you counting only the top level inserts or also the ones
generated by the recursive inserts?

> My question.
>
> How to avoid the bottleneck?

First you need to find out what the bottleneck is.

> Parallel processing is possible in Postgres? How?

To achieve parallel processing in PostgreSQL you need to use
multiple connections.

-Kevin





--000e0cd6b306f1f2b504a6b2d3ff--