pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Yves Dorfsman <yves@zioup.com>
To: pgsql-performance@postgresql.org
Subject: Re: Postgres is using 100% CPU
Date: Sun, 31 May 2015 08:23:10 -0600
Message-ID: <556B194E.2040709@zioup.com> (raw)
In-Reply-To: <556B06FA.3000305@verizon.net>
References: <CAC=-3DfaqG0OguwRaUP1AzS-hY4=v9RCjZoiqbWtvGHAR43ecQ@mail.gmail.com>
	<CAC=-3DcOyOi3Ubxf0LpOTV07wVOfFowcEw1SBtPOvKGnNn+PqA@mail.gmail.com>
	<CAC=-3Dcp4XGhM9BjO+6DQhVr+8ac-vEQCduokc3D6U9SheKf1g@mail.gmail.com>
	<5568BBFF.8080807@2ndquadrant.com>
	<CAC=-3Dc6RhLgCqO4sNscOQFT0TybVNHciPdvFEwfhvK0Ta3YMw@mail.gmail.com>
	<556B06FA.3000305@verizon.net>
List-Unsubscribe:  <mailto:majordomo@postgresql.org?body=unsub%20pgsql-performance>

On 2015-05-31 07:04, Jean-David Beyer wrote:
> On 05/30/2015 09:46 AM, Ashik S L wrote:
>> We are using postgres SQL version 8.4.17..
>> Postgres DB szie is 900 MB and we are inserting 273 rows at once .and
>> each row is of 60 bytes.Every time we insert 16380 bytes of data.
> 
> Way back when, I was inserting a lot of rows of date (millions of rows)
> and it was taking many hours on a machine with 6 10,000 rpm Ultra/320
> SCSI hard drives and 8 GBytes of ram. Each insert was a separate
> transaction.
> 
> When I bunched up lots of rows (thousaands) into a single transaction,
> the whole thing took less than an hour.

Or use copy, \copy if possible, or a "temporary" unlogged table to copy from
later, etc...

> Is it possible that when you insert 273 rows at once, you are doing it
> as 273 transactions instead of one?

That's the thing, even on an old laptop with a slow IDE disk, 273 individual
inserts should not take more than a second.

-- 
http://yves.zioup.com
gpg: 4096R/32B0F416



-- 
Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-performance



view thread (17+ messages)  latest in thread

Message-ID: <556B194E.2040709@zioup.com>
Permalink:  ../556B194E.2040709@zioup.com/
Also on:    postgresql.org/message-id/556B194E.2040709@zioup.com

 · 

reply

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 using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: yves@zioup.com
  Subject: Re: Postgres is using 100% CPU
  In-Reply-To: <556B194E.2040709@zioup.com>

* 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