Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id 90FF3B5DCD1 for ; Wed, 31 Aug 2011 18:11:59 -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 47911-01 for ; Wed, 31 Aug 2011 21:11:53 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by mail.postgresql.org (Postfix) with ESMTP id 12109B5DC4E for ; Wed, 31 Aug 2011 18:11:52 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id p7VLBoK6003941; Wed, 31 Aug 2011 17:11:50 -0400 (EDT) To: Lampa cc: pgsql-bugs@postgresql.org Subject: Re: BUG #6186: out of memory while analyze In-reply-to: References: <201108301120.p7UBKKoJ094519@wwwmaster.postgresql.org> <25153.1314732080@sss.pgh.pa.us> Comments: In-reply-to Lampa message dated "Wed, 31 Aug 2011 07:25:50 +0200" Date: Wed, 31 Aug 2011 17:11:50 -0400 Message-ID: <3940.1314825110@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-2.404 tagged_above=-5 required=5 tests=BAYES_00=-1.9, RP_MATCHES_RCVD=-0.504 X-Spam-Level: X-Archive-Number: 201108/203 X-Sequence-Number: 31015 Lampa writes: > default_statistics_target = 8000 # range 1-10000 > Problem seems to be in default_statistics_target values from approx > 6300. Up to 6300 analyze works but on another machine (64bit) works > 10000 without problems on same but larger table (more data) Well, there's a reason why the default value of that parameter is 100 and not 10000 ;-). The larger it is, the more memory space it's going to take to do an ANALYZE. I don't see any bug here, you're just trying to do more than you can do in a 32-bit machine. I guess we could improve the documentation of default_statistics_target to point out that it costs not only more time but more memory in ANALYZE. regards, tom lane