Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id AF43BB5DBBE for ; Thu, 4 Aug 2011 13:12:07 -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 57714-05 for ; Thu, 4 Aug 2011 16:12:00 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-fx0-f46.google.com (mail-fx0-f46.google.com [209.85.161.46]) by mail.postgresql.org (Postfix) with ESMTP id 7FD1FB5DBDA for ; Thu, 4 Aug 2011 13:12:00 -0300 (ADT) Received: by fxh19 with SMTP id 19so1878244fxh.19 for ; Thu, 04 Aug 2011 09:11:59 -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=ORz0lKnX6qFbWjOumL06l+MIzLSa2txC2Z9DyUBsQYc=; b=rmuDoeKTDcYue1ximtKvjQ3zrdD9BAiVxOCey7/4qcnnOltTegBHthgsBYvxyx7wcd KvzRWdIri/4ZCxK8bV4RE3W5poXe8q5HnTfbxgYuDntEe/RE/pVh9y4sfMZVxrywA/Nh EwgkIUcfGRuAIB3y3e+7YipxbbAPSrcF85vv4= Received: by 10.223.74.208 with SMTP id v16mr1381579faj.145.1312474319527; Thu, 04 Aug 2011 09:11:59 -0700 (PDT) Received: from [10.64.1.26] ([94.45.140.16]) by mx.google.com with ESMTPS id 6sm231042fas.26.2011.08.04.09.11.57 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 04 Aug 2011 09:11:58 -0700 (PDT) Message-ID: <4E3AC4CE.2000507@gmail.com> Date: Thu, 04 Aug 2011 19:11:58 +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: Kevin Grittner CC: Robert Ayrapetyan , pgsql-performance@postgresql.org Subject: Re: Performance die when COPYing to table with bigint PK References: <4E366C9C.4040904@gmail.com> <4E37F07D020000250003F9A7@gw.wicourts.gov> <4E3A7BAC020000250003FA6C@gw.wicourts.gov> In-Reply-To: <4E3A7BAC020000250003FA6C@gw.wicourts.gov> 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/58 X-Sequence-Number: 44505 04.08.11 18:59, Kevin Grittner написав(ла): > Robert Ayrapetyan wrote: >> Kevin Grittner wrote: > >> [regarding tests which do show the problem] >> tried same with 2 columns (bigint and int) - it didn't produced >> such effect probably because data volume has critical effect. > > Based on what you're showing, this is almost certainly just a matter > of pushing your volume of active data above the threshold of what > your cache holds, forcing it to do disk access rather than RAM > access for a significant portion of the reads. > > -Kevin Yep. Seems so. Plus famous "you'd better insert data, then create indexes". On my database it takes twice the time for int8 then for int4 to insert data. Also it takes ~twice a time (2 hours) to add 200K of rows to 200M of rows than to make an index over 200M of rows (1 hour). Best regards, Vitalii Tymchyshyn