pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Alessandro Ipe <Alessandro.Ipe@meteo.be>
Cc: pgsql-performance@postgresql.org, Torsten Zuehlsdorff <mailinglists@toco-domains.de>
Subject: Re: Excessive memory used for INSERT
Date: Thu, 18 Dec 2014 12:05:45 -0500
Message-ID: <17790.1418922345@sss.pgh.pa.us> (raw)
In-Reply-To: <6053205.R7VxckQEVY@snow.oma.be>
References: <2163931.4eVnXNjHa3@snow.oma.be>
	<4171.1418838543@sss.pgh.pa.us>
	<6645627.5dTte5MPLk@snow.oma.be>
	<6053205.R7VxckQEVY@snow.oma.be>
List-Unsubscribe:  <mailto:majordomo@postgresql.org?body=unsub%20pgsql-performance>

Alessandro Ipe <Alessandro.Ipe@meteo.be> writes:
> Hi,
> I tried also with an upsert function
> CREATE FUNCTION upsert_func(sql_insert text, sql_update text) RETURNS void
>     LANGUAGE plpgsql
>     AS $$
> BEGIN
> EXECUTE sql_update;
> IF FOUND THEN
>         RETURN;
>     END IF;
>     BEGIN
> EXECUTE sql_insert;
> EXCEPTION WHEN OTHERS THEN
> EXECUTE sql_update;
> END;
>     RETURN;
> END;
> $$;
> with the same result on the memory used... 

If you want to provide a self-contained test case, possibly we could look
into it, but these fragmentary bits of what you're doing don't really
constitute an investigatable problem statement.

I will note that EXCEPTION blocks aren't terribly cheap, so if you're
reaching the "EXECUTE sql_insert" a lot of times that might have something
to do with it.

			regards, tom lane


-- 
Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-performance



view thread (15+ messages)  latest in thread

Message-ID: <17790.1418922345@sss.pgh.pa.us>
Permalink:  ../17790.1418922345@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/17790.1418922345@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 using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: tgl@sss.pgh.pa.us, Alessandro.Ipe@meteo.be, mailinglists@toco-domains.de
  Subject: Re: Excessive memory used for INSERT
  In-Reply-To: <17790.1418922345@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