Re: slow speeds after 2 million rows inserted

From: "Joshua D(dot) Drake" <jd(at)commandprompt(dot)com>
To: Rodrigo Gonzalez <rjgonzale(at)gmail(dot)com>
Cc: James Neff <jneff(at)tethyshealth(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: slow speeds after 2 million rows inserted
Date: 2006-12-29 18:10:55
Message-ID: 1167415855.21290.4.camel@localhost.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


> > there is also an index on batchid.
> >
> > The insert command is like so:
> >
> > "INSERT INTO data_archive (batchid, claimid, memberid, raw_data, status,
> > line_number) VALUES ('" + commandBatchID + "', '', '', '" + raw_data +
> > "', '1', '" + myFilter.claimLine + "');";

Also as you are running 8.2 you can use multi valued inserts...

INSERT INTO data_archive values () () ()

> >
> > where the raw_data variable is the line from the file.
> >
> > How can I find out what is causing this slow down and how do I speed it up?
> >
> > Database is 8.2.0 on x86_64-unknown-linux-gnu.
> >
> > There is nothing else running on this database server (other than
> > standard linux background programs). PS ax did not show anything else
> > running. No locks other than the occasional lock by the INSERT query.
> > I have done a FULL vacuum on this table but not reindex (running now).
> >
> > Thanks in advance,
> > James
> >
> > ---------------------------(end of broadcast)---------------------------
> > TIP 2: Don't 'kill -9' the postmaster
> >
>
> Consider using copy
>
> ---------------------------(end of broadcast)---------------------------
> TIP 9: In versions below 8.0, the planner will ignore your desire to
> choose an index scan if your joining column's datatypes do not
> match
>
--

=== The PostgreSQL Company: Command Prompt, Inc. ===
Sales/Support: +1.503.667.4564 || 24x7/Emergency: +1.800.492.2240
Providing the most comprehensive PostgreSQL solutions since 1997
http://www.commandprompt.com/

Donate to the PostgreSQL Project: http://www.postgresql.org/about/donate

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Frank Finner 2006-12-29 18:16:57 Re: slow speeds after 2 million rows inserted
Previous Message Ragnar 2006-12-29 18:03:05 Re: could not open relation:no such file or directory