Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id DA55B632A50 for ; Sun, 6 Jun 2010 14:47:00 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 19396-02 for ; Sun, 6 Jun 2010 17:46:53 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-yw0-f182.google.com (mail-yw0-f182.google.com [209.85.211.182]) by mail.postgresql.org (Postfix) with ESMTP id 861126329C9 for ; Sun, 6 Jun 2010 14:46:53 -0300 (ADT) Received: by ywh12 with SMTP id 12so1728933ywh.14 for ; Sun, 06 Jun 2010 10:46:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=AeWmDPYsn+A6v+h2R3B3FDhyu5E2Ms9qP4l1mfxzxW0=; b=dnY/XgEir/u9l9VbNLlCpvKGOe79uD7Hq5QqDLolLGe1C5l/mcX9upCOyfPwq0PhN/ s38X/UncECWl4D3E7NlsNiR808NV1/ni0PZh3hhcorSgkF3DzM097qnPXH+RLPE59ujf FhxLkxbNHLmN0GIE2N6EXms95khLX2C7qInsE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=M4yKsKlBdoFr5DE4ZghF4jfEl1nfMI6TsvG7l37psshh1c24r5NgsoII/S1aJcHPz7 N8t/9v/vLwOFvMmf92tNZRp9zyh0LtH6scxldFJtp1rtHqM51HsxAO4MtyMNb1UKwHI5 wUeE1C2QlIAINa756gv6u9aZuSle96uKZxE7Y= MIME-Version: 1.0 Received: by 10.150.74.20 with SMTP id w20mr12359494yba.251.1275846412285; Sun, 06 Jun 2010 10:46:52 -0700 (PDT) Received: by 10.151.13.3 with HTTP; Sun, 6 Jun 2010 10:46:52 -0700 (PDT) In-Reply-To: References: <4C07E418.80103@meisterderspiele.de> Date: Sun, 6 Jun 2010 11:46:52 -0600 Message-ID: Subject: Re: How to insert a bulk of data with unique-violations very fast From: Scott Marlowe To: =?ISO-8859-1?Q?Torsten_Z=FChlsdorff?= Cc: pgsql-performance@postgresql.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.585 tagged_above=-10 required=5 tests=BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001, SARE_MILLIONSOF=0.315 X-Spam-Level: X-Archive-Number: 201006/129 X-Sequence-Number: 38985 On Sun, Jun 6, 2010 at 6:02 AM, Torsten Z=FChlsdorff wrote: > Scott Marlowe schrieb: > Thank you very much for your example. Now i've got it :) > > I've test your example on a small set of my rows. While testing i've > stumpled over a difference in sql-formulation. Using except seems to be a > little slower than the more complex where not in (subquery) group by. Her= e > is my example: Yeah, to get a good idea you need a more realistic example. Build some tables with millions of rows using generate_series() and then test against those.