Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Yz497-00054X-Fy for pgsql-performance@arkaria.postgresql.org; Sun, 31 May 2015 14:23:25 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1Yz495-0006sv-UB for pgsql-performance@arkaria.postgresql.org; Sun, 31 May 2015 14:23:23 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1Yz493-0006sm-Qs for pgsql-performance@postgresql.org; Sun, 31 May 2015 14:23:21 +0000 Received: from smtp-out-so.shaw.ca ([64.59.136.139]) by magus.postgresql.org with esmtp (Exim 4.84) (envelope-from ) id 1Yz48z-00006q-2j for pgsql-performance@postgresql.org; Sun, 31 May 2015 14:23:20 +0000 Received: from home.zioup.com ([70.72.160.156]) by shaw.ca with SMTP id z48tYoUPlImD1z48uYfWCc; Sun, 31 May 2015 08:23:13 -0600 X-Authority-Analysis: v=2.1 cv=AKFJgQ79 c=1 sm=1 tr=0 a=1AzCEyHvRsrOnBOCSdCQag==:117 a=1AzCEyHvRsrOnBOCSdCQag==:17 a=N8iSzGwtAAAA:8 a=hTJJpgObMeYA:10 a=IkcTkHD0fZMA:10 a=EcwkyOLhAAAA:8 a=h1PgugrvaO0A:10 a=dZzLds4irlntX1NhqBAA:9 a=QEXdDO2ut3YA:10 Received: from [192.168.2.80] (epicurus.zioup.net [192.168.2.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by home.zioup.com (Postfix) with ESMTPSA id 19E5CA02A7 for ; Sun, 31 May 2015 08:23:11 -0600 (MDT) Message-ID: <556B194E.2040709@zioup.com> Date: Sun, 31 May 2015 08:23:10 -0600 From: Yves Dorfsman User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: pgsql-performance@postgresql.org Subject: Re: Postgres is using 100% CPU References: <5568BBFF.8080807@2ndquadrant.com> <556B06FA.3000305@verizon.net> In-Reply-To: <556B06FA.3000305@verizon.net> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-CMAE-Envelope: MS4wfKLkK0ShaVUJjFLWDakJ9jpWjs8KMruSFWdMnEIWAX9cGvJt7HUDQXnMo2ABsIANrJ42gqs6i97upyWCWFnUZSTg8TnCB/1ht95x4G+fXg9jz5BmbbIWQ2A1yCY4xve0r41KCEZJj14lP/386xXU4M7y7CxaCT4DIoHHZHweR4DQ0LKvHfeJ2MfGD+JE0CC1bA== X-Pg-Spam-Score: -2.6 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-performance Precedence: bulk Sender: pgsql-performance-owner@postgresql.org 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