Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dVJbh-0002e6-Vy for pgsql-bugs@arkaria.postgresql.org; Wed, 12 Jul 2017 15:31:18 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1dVJbh-0001qk-Fc for pgsql-bugs@arkaria.postgresql.org; Wed, 12 Jul 2017 15:31:17 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1dVJbg-0001qS-UL for pgsql-bugs@postgresql.org; Wed, 12 Jul 2017 15:31:16 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1dVJbe-0007yZ-56 for pgsql-bugs@postgresql.org; Wed, 12 Jul 2017 15:31:16 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id v6CFUx1K004428; Wed, 12 Jul 2017 11:31:02 -0400 From: Tom Lane To: Heikki Linnakangas cc: james+postgres@carbocation.com, pgsql-bugs@postgresql.org Subject: Re: BUG #14654: With high statistics targets on ts_vector, unexpectedly high memory use & OOM are triggered In-reply-to: References: <20170514200602.1451.46797@wrigleys.postgresql.org> Comments: In-reply-to Heikki Linnakangas message dated "Wed, 12 Jul 2017 14:32:11 +0300" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <4426.1499873459.1@sss.pgh.pa.us> Date: Wed, 12 Jul 2017 11:30:59 -0400 Message-ID: <4427.1499873459@sss.pgh.pa.us> List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org Heikki Linnakangas writes: > Yes, I can see that happening here too. The problem seems to be that the > analyze-function detoasts every row in the sample. Tsvectors can be very > large, so it adds up. > That's pretty easy to fix, the analyze function needs to free the > detoasted copies as it goes. But in order to do that, it needs to make > copies of all the lexemes stored in the hash table, instead of pointing > directly to the detoasted copies. > Patch attached. I think this counts as a bug, and we should backport this. +1. I didn't test the patch, but it looks sane to the eyeball. regards, tom lane -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs