pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Heikki Linnakangas <hlinnaka@iki.fi>
Cc: james+postgres@carbocation.com
Cc: pgsql-bugs@postgresql.org
Subject: Re: BUG #14654: With high statistics targets on ts_vector, unexpectedly high memory use & OOM are triggered
Date: Wed, 12 Jul 2017 11:30:59 -0400
Message-ID: <4427.1499873459@sss.pgh.pa.us> (raw)
In-Reply-To: <dc65ba89-46d1-07f2-3f94-51ba00446931@iki.fi>
References: <20170514200602.1451.46797@wrigleys.postgresql.org>
	<dc65ba89-46d1-07f2-3f94-51ba00446931@iki.fi>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>

Heikki Linnakangas <hlinnaka@iki.fi> 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



view thread (4+ messages)  latest in thread

Message-ID: <4427.1499873459@sss.pgh.pa.us>
Permalink:  ../4427.1499873459@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/4427.1499873459@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, hlinnaka@iki.fi, james+postgres@carbocation.com
  Subject: Re: BUG #14654: With high statistics targets on ts_vector, unexpectedly high memory use & OOM are triggered
  In-Reply-To: <4427.1499873459@sss.pgh.pa.us>
  References: <20170514200602.1451.46797@wrigleys.postgresql.org> <dc65ba89-46d1-07f2-3f94-51ba00446931@iki.fi> <4427.1499873459@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox