Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id 157A1B5DC01 for ; Mon, 1 Aug 2011 06:06:50 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 30884-07 for ; Mon, 1 Aug 2011 09:06:42 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-ew0-f46.google.com (mail-ew0-f46.google.com [209.85.215.46]) by mail.postgresql.org (Postfix) with ESMTP id 7AA84B5DBE2 for ; Mon, 1 Aug 2011 06:06:42 -0300 (ADT) Received: by ewy4 with SMTP id 4so2685116ewy.19 for ; Mon, 01 Aug 2011 02:06:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=pcUu7YIyCyuJwElgjtwP8c2JsBxWTwglKLg55cbhzPo=; b=cRx1jAR+aKAK47jOe8UJEC6NZ5exZi2Mfh8Y0Ubx3fxRFRH63xjQB5lSiqwydkDLs+ HOHPrtD1bbArXLfIgsA+bu0oG3XjeQ9rbuc3NuhiFVJ+2WUF5/zqsR+VjG20YtsmXuR8 AEkX+SCzvCyz1yXCtRbjQtw50iMWxB4D8Ycoc= Received: by 10.204.157.13 with SMTP id z13mr1105529bkw.309.1312189601679; Mon, 01 Aug 2011 02:06:41 -0700 (PDT) Received: from [10.64.1.26] ([213.108.72.250]) by mx.google.com with ESMTPS id p24sm1249272bkw.8.2011.08.01.02.06.40 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 01 Aug 2011 02:06:40 -0700 (PDT) Message-ID: <4E366C9C.4040904@gmail.com> Date: Mon, 01 Aug 2011 12:06:36 +0300 From: Vitalii Tymchyshyn User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.18) Gecko/20110617 Lightning/1.0b2 Thunderbird/3.1.11 MIME-Version: 1.0 To: Robert Ayrapetyan CC: pgsql-performance@postgresql.org Subject: Re: Performance die when COPYing to table with bigint PK References: In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.799 tagged_above=-10 required=5 tests=BAYES_00=-1.9, FREEMAIL_ENVFROM_END_DIGIT=0.1, FREEMAIL_FROM=0.001 X-Spam-Level: X-Archive-Number: 201108/5 X-Sequence-Number: 44452 31.07.11 16:51, Robert Ayrapetyan написав(ла): > Hello. > > I've found strange behavior of my pg installation (tested both 8.4 and > 9.0 - they behave same) on FreeBSD platform. > In short - when some table have PK on bigint field - COPY to that > table from file becomes slower and slower as table grows. When table > reaches ~5GB - COPY of 100k records may take up to 20 mins. I've > experimented with all params in configs, moved indexes to separate hdd > etc - nothing made any improvement. However, once I'm dropping 64 bit > PK - COPY of 100k records passes in seconds. Interesting thing - same > table has other indexes, including composite ones, but none of them > include bigint fields, that's why I reached decision that bug > connected with indexes on bigint fields only. I did see this behavior, but as for me it occurs for UNIQUE indexes only (including PK), not dependent on field type. You can check this by dropping PK and creating it as a regular non-unique index. Best regards, Vitalii Tymchyshyn