Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dJLIN-0008MM-1d for pgsql-performance@arkaria.postgresql.org; Fri, 09 Jun 2017 14:53:51 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1dJLIM-0001nn-FV for pgsql-performance@arkaria.postgresql.org; Fri, 09 Jun 2017 14:53:50 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1dJLIL-0001nG-Kx for pgsql-performance@postgresql.org; Fri, 09 Jun 2017 14:53:49 +0000 Received: from aart.rice.edu ([168.7.56.48]) by makus.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dJLIJ-0006tp-E9 for pgsql-performance@postgresql.org; Fri, 09 Jun 2017 14:53:48 +0000 Received: by aart.rice.edu (Postfix, from userid 18612) id 07E374069666; Fri, 9 Jun 2017 09:53:47 -0500 (CDT) Date: Fri, 9 Jun 2017 09:53:47 -0500 From: Kenneth Marshall To: Frits Jalvingh Cc: Scott Marlowe , Andreas Kretschmer , "pgsql-performance@postgresql.org" Subject: Re: Improving PostgreSQL insert performance Message-ID: <20170609145347.GE26506@aart.rice.edu> References: <9e2a0a34-dd83-43af-d41a-791b34ff76e1@a-kretschmer.de> <20170609132857.GC26506@aart.rice.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-Pg-Spam-Score: -1.9 (-) 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 Fri, Jun 09, 2017 at 02:39:37PM +0000, Frits Jalvingh wrote: > Hi all, > > Thanks a lot for the many responses! > > About preparing statements: this is done properly in Java, and pgsql does > it by itself. So that cannot be done better ;) > > I tried the copy command, and that indeed works quite brilliantly: > Inserted 24000000 rows in 22004 milliseconds, 1090710.7798582076 rows per > second > > That's faster than Oracle. But with a very bad interface I have to say for > normal database work.. I will try to make this work in the tooling, but it > needs some very special code to format all possible values properly, and to > manage the end of the copy, so it is not usable in general which is a pity, > I think. > > So, I am still very interested in getting normal inserts faster, because > that will gain speed for all work.. If Oracle can do it, and Postgres is > able to insert fast with copy- where lies the bottleneck with the insert > command? There seems to be quite a performance hit with the JDBC driver > itself (as the stored procedure is a lot faster), so I can look into that. > But even after that there is quite a gap.. > > Regards, > > Frits Hi Frits, Have you looked at UNLOGGED tables and also having more that 1 insert stream running at a time. Sometimes multiple parallel inserts can be faster. Regards, Ken -- Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-performance