X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 4989753236 for ; Mon, 2 May 2005 12:17:24 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 14316-08 for ; Mon, 2 May 2005 15:17:20 +0000 (GMT) Received: from rproxy.gmail.com (rproxy.gmail.com [64.233.170.206]) by svr1.postgresql.org (Postfix) with ESMTP id 3425553224 for ; Mon, 2 May 2005 12:17:19 -0300 (ADT) Received: by rproxy.gmail.com with SMTP id a41so910115rng for ; Mon, 02 May 2005 08:17:19 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=gyBLtuQiLOOzS8bK8MBkTzkl8gwc365ikNx/d7mEQfeoqLty8ZkjRhVCTE3JnTHa7nx0WBkD9jsUvAmnX6GfszwJcm+Vo8PPLCu+KblgTkYP8RiY8xS+Rs0nuWx6OFNJjFzSBRYff6ivXL+yYdjfyKgVhiBlua7OOZ6kgPXQd3E= Received: by 10.38.12.8 with SMTP id 8mr6312512rnl; Mon, 02 May 2005 08:17:18 -0700 (PDT) Received: by 10.38.207.41 with HTTP; Mon, 2 May 2005 08:17:18 -0700 (PDT) Message-ID: <59d991c405050208174b6ebbc@mail.gmail.com> Date: Mon, 2 May 2005 11:17:18 -0400 From: Christopher Petrilli Reply-To: Christopher Petrilli To: tim@se.linux.org Subject: Re: batch inserts are "slow" Cc: pgsql-performance@postgresql.org In-Reply-To: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.319 tagged_above=0 required=5 tests=AWL, DNS_FROM_RFC_ABUSE, RCVD_BY_IP X-Spam-Level: X-Archive-Number: 200505/4 X-Sequence-Number: 12168 On 5/2/05, Tim Terleg=E5rd wrote: > Howdy! >=20 > I'm converting an application to be using postgresql instead of oracle. > There seems to be only one issue left, batch inserts in postgresql seem > significant slower than in oracle. I have about 200 batch jobs, each > consisting of about 14 000 inserts. Each job takes 1.3 seconds in > postgresql and 0.25 seconds in oracle. With 200 jobs this means several > more minutes to complete the task. By fixing this I think the > application using postgresql over all would be faster than when using > oracle. Just as on Oracle you would use SQL*Loader for this application, you should use the COPY syntax for PostgreSQL. You will find it a lot faster. I have used it by building the input files and executing 'psql' with a COPY command, and also by using it with a subprocess, both are quite effective. Chris --=20 | Christopher Petrilli | petrilli@gmail.com