From: Kevin Grittner <Kevin.Grittner@wicourts.gov>
To: siva palanisamy <psivait@gmail.com>
To: pgsql-performance@postgresql.org
Cc: Siva Palanisamy <siva_p@hcl.com>
Subject: Re: Optimization required for multiple insertions in PostgreSQL
Date: Thu, 03 Nov 2011 11:05:58 -0500
Message-ID: <4EB27596020000250004298C@gw.wicourts.gov> (raw)
In-Reply-To: <CA+AN_OYTUtY107A6gz6WV4ULDuMP1XHs5C6vhdYvnRjCXZzDOg@mail.gmail.com>
References: <CA+AN_OYTUtY107A6gz6WV4ULDuMP1XHs5C6vhdYvnRjCXZzDOg@mail.gmail.com>
siva palanisamy <psivait@gmail.com> wrote:
> I basically have 3 tables. One being the core table and the other
> 2 depend on the 1st. I have the requirement to add upto 70000
> records in the tables. I do have constraints (primary & foreign
> keys, index, unique etc) set for the tables. I can't go for bulk
> import (using COPY command) as there is no standard .csv file in
> requirement, and the mapping is explicitly required plus few
> validations are externally applied in a C based programming file.
> Each record details (upto 70000) will be passed from .pgc (an ECPG
> based C Programming file) to postgresql file. It takes less time
> for the 1st few records and the performance is turning bad to the
> latter records! The result is very sad that it takes days to cover
> upto 20000! What are the performance measures could I step in into
> this? Please guide me
There's an awful lot you're not telling us, like what version of
PostgreSQL you're using, what your hardware looks like, how many
rows you're trying to insert per database transaction, what resource
looks like on the machine when it's running slow, what the specific
slow queries are and what their execution plans look like, etc. I
could make a lot of guesses and take a shot in the dark with some
generic advice, but you would be better served by the more specific
advice you will get if you provide more detail.
Please review this page (and its links) and post again:
http://wiki.postgresql.org/wiki/SlowQueryQuestions
-Kevin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-performance@postgresql.org
Cc: Kevin.Grittner@wicourts.gov, psivait@gmail.com, siva_p@hcl.com
Subject: Re: Optimization required for multiple insertions in PostgreSQL
In-Reply-To: <4EB27596020000250004298C@gw.wicourts.gov>
References: <CA+AN_OYTUtY107A6gz6WV4ULDuMP1XHs5C6vhdYvnRjCXZzDOg@mail.gmail.com> <4EB27596020000250004298C@gw.wicourts.gov>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox