Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dJtGj-0003YE-JW for pgsql-performance@arkaria.postgresql.org; Sun, 11 Jun 2017 03:10:25 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1dJtGh-0000rh-QD for pgsql-performance@arkaria.postgresql.org; Sun, 11 Jun 2017 03:10:23 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1dJtGh-0000r0-0K for pgsql-performance@postgresql.org; Sun, 11 Jun 2017 03:10:23 +0000 Received: from mail-qt0-x22c.google.com ([2607:f8b0:400d:c0d::22c]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1dJtGd-0002CP-Go for pgsql-performance@postgresql.org; Sun, 11 Jun 2017 03:10:21 +0000 Received: by mail-qt0-x22c.google.com with SMTP id w1so100683101qtg.2 for ; Sat, 10 Jun 2017 20:10:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:mime-version:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=AuwAAwhTpAjHP8JvwUrnOmlCCQc0jwXwLTDr0ELWjuM=; b=1nCpE0/2bcRB1fb+zAc/29B6vbAXr6vMr5KOclRCnPs/QliiDVeb1mbChYvFKQoVAv w7432zJzLbP2Wjurb8ut+haqCj1O8Zn3iHCHfMz1cMwiPpDR17InsjBBi5l789kkhewf B3yfikrfWUU6CAkr9dge8xDHQrHKMrqNKGH3V8V+pVxieTTA8pGHGiHqWBOkDu5gn50w Et8qR4HfEXL99lY76ZwYL+sfu9S9dAuv6Nk7F2DFNldjN+xXlJa59DrgScs2sHI7rfnE XU5bl+8JdL0T+8t3/om+lClVFFVFiJ2HVDJjq1FsXTW+f45vZycWqZZEeW2lE6tVIB8l rtgA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=AuwAAwhTpAjHP8JvwUrnOmlCCQc0jwXwLTDr0ELWjuM=; b=uLWeHIsEDORZ1tbRNpcI26kXVFJrlPleGffVakeANLwV/42tjjLabmQWy6Jf8IeaD/ Gy1KN+0lHRI+7/q6ew7CTUVbVAARnvYqDWiyqvenrGUT+pMqrZXSASoi1UNoYdepHpm4 AVxtoGgbd7sWfXEHa6JtuzBruDgtWTx94XOfihrDPN3jXc7uoO9ck0XZcJM5IrTJGh/h pdgB4Qyq1mggcEl2U71I4Sm5B1VE1DhCehzcmxNtr87smfaIhGND7Xuqss4qGAi97rxg bT/RrXna4KLRSZLcYzpk3UidmqSHgdBk/bI9P9phYINALYvGjT1ug1euCk8zt6GNDCsy a3AA== X-Gm-Message-State: AKS2vOwrVoIg+Zc7cQuq0Q+SECU3H0UEbI8+kevtds7DLFFvstfbnCD4 e0ZILcm3+jGB1BJL X-Received: by 10.200.52.181 with SMTP id w50mr11195994qtb.77.1497150617386; Sat, 10 Jun 2017 20:10:17 -0700 (PDT) Received: from alvin.alvh.no-ip.org ([186.9.132.71]) by smtp.gmail.com with ESMTPSA id o69sm1425790qko.52.2017.06.10.20.10.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 10 Jun 2017 20:10:16 -0700 (PDT) Received: by alvin.alvh.no-ip.org (Postfix, from userid 1000) id 0C257C9D; Sat, 10 Jun 2017 23:32:14 -0300 (-03) Date: Sat, 10 Jun 2017 22:32:14 -0400 From: Alvaro Herrera To: Frits Jalvingh Cc: Scott Marlowe , Kenneth Marshall , Andreas Kretschmer , "pgsql-performance@postgresql.org" Subject: Re: Improving PostgreSQL insert performance Message-ID: <20170611023214.r2yucev656ojv3pi@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: NeoMutt/20170306-137-4415bd-dirty (1.8.0) 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 Frits Jalvingh wrote: > 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.. Did you try inserting multiple tuples in one command? Something like INSERT INTO .. VALUES ('col1', 'col2'), ('col1', 'col2'), ('col1', 'col2') It's supposed to be faster than single-row inserts, though I don't know by how much. -- Álvaro Herrera https://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services -- Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-performance