Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id 6FEABB5DC2B for ; Mon, 29 Aug 2011 22:30:55 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 93902-04 for ; Tue, 30 Aug 2011 01:30:49 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-pz0-f42.google.com (mail-pz0-f42.google.com [209.85.210.42]) by mail.postgresql.org (Postfix) with ESMTP id 10D7FB5DC06 for ; Mon, 29 Aug 2011 22:30:48 -0300 (ADT) Received: by pzk37 with SMTP id 37so15745652pzk.15 for ; Mon, 29 Aug 2011 18:30:48 -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=bWObSWpr2EBQrF2CgHOVKm3DTkC0kSIfaSRUJSq2VwI=; b=m1+pES9Qehl+i9N8y+41Z17bTImgwaNkO6QAHQkiez3nViBvNuTl/rF/FzllzfBuzx eGIK8Xw/eYvm/dDGAclfTISez3xZJDvRjGsN3CC1GO6REYoEItglsqGyndVdXdKakP2o /8859uc9TODaLd2lBi0ToYgWPb/vkdJ5Upu5o= Received: by 10.142.142.20 with SMTP id p20mr2848592wfd.439.1314667848538; Mon, 29 Aug 2011 18:30:48 -0700 (PDT) Received: from [192.168.1.4] ([116.231.61.141]) by mx.google.com with ESMTPS id t6sm6772548pbg.4.2011.08.29.18.30.09 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 29 Aug 2011 18:30:46 -0700 (PDT) Message-ID: <4E5C3D14.1060907@gmail.com> Date: Tue, 30 Aug 2011 09:29:56 +0800 From: Rural Hunter User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:6.0) Gecko/20110812 Thunderbird/6.0 MIME-Version: 1.0 To: Kevin Grittner CC: Julio Leyva , pgsql-admin@postgresql.org Subject: Re: plsql gets "out of memory" References: <4E5B8FF7.4040007@gmail.com> <4E5B9604.5070602@gmail.com> <4E5B518002000025000407E5@gw.wicourts.gov> <4E5BA3C0.7080909@gmail.com> <4E5B67910200002500040805@gw.wicourts.gov> <4E5BB423.6010303@gmail.com> <4E5B72980200002500040820@gw.wicourts.gov> In-Reply-To: <4E5B72980200002500040820@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.899 tagged_above=-10 required=5 tests=BAYES_00=-1.9, FREEMAIL_FROM=0.001 X-Spam-Level: X-Archive-Number: 201108/231 X-Sequence-Number: 38218 Thank you. I didn't understand what 'vacuum freeze' actually does. I will check the detail to see if it's good for my situation. and I will also test the load by tcp connection. Thanks again for all your advices and they are really very helpful to me! 于 2011/8/30 0:06, Kevin Grittner 写道: > Rural Hunter wrote: >> 2011/8/29 23:18, Kevin Grittner: > >>> I also recommend a VACUUM FREEZE ANALYZE on the database unless >>> most of these rows will be deleted or updated before you run a >>> billion database transactions. Otherwise you will get a painful >>> "anti-wraparound" autovacuum on everything, probably at a time >>> of heavy usage. >> hmm....I will try to turn autovacuum off though I didn't see any >> resource intension caused by it. > > Well, turning off autovacuum during a bulk load is probably a net > gain if it's insert-only (i.e., no need to query just-loaded data to > decide what to do with new rows); but that's not what I was getting > at. Bulk loading 200 GB of data which is not going to be deleted or > updated heavily is setting a performance time bomb without a VACUUM > FREEZE. At some point, perhaps months later, it will be necessary > to freeze the tuples to prevent data loss, and since this occurs > based on a threshold of how many transaction IDs have been consumed, > it is most likely to happen at peak OLTP loads, when it will be the > biggest problem. A VACUUM FREEZE (and you might as well throw in > ANALYZE while you're at it) will take care of that up front. As a > side benefit it will keep SELECT statements from generating heavy > *write* loads on the first access to tuples, and will perform other > maintenance which will improve database performance. > > I just count the time for VACUUM FREEZE ANALYZE as part of the bulk > load time required before letting in users. > >>> Network latency? > >> No, I do the import locally on the db server so the network >> letency can be excluded. > > Hmm... I don't remember the details, but there was a problem at > some point where Linux pipe connections could introduce significant > latency, and you could get much better performance on a TCP > connection through localhost. It might be worth a try. (Maybe > someone else will remember the details.) > > -Kevin >