pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Hannu Krosing <hannu@tm.ee>
To: Josh Berkus <josh@agliodbs.com>
Cc: Tambet Matiisen <t.matiisen@aprote.ee>
Cc: pgsql-performance@postgresql.org
Subject: Re: One tuple per transaction
Date: Thu, 17 Mar 2005 23:27:25 +0200
Message-ID: <1111094845.6281.1.camel@fuji.krosing.net> (raw)
In-Reply-To: <200503121405.20943.josh@agliodbs.com>
References: <A66A11DBF5525341AEF6B8DE39CDE77008804D@black.aprote.com>
	<200503121405.20943.josh@agliodbs.com>

On L, 2005-03-12 at 14:05 -0800, Josh Berkus wrote:
> Tambet,
> 
> > In one of our applications we have a database function, which
> > recalculates COGS (cost of good sold) for certain period. This involves
> > deleting bunch of rows from one table, inserting them again in correct
> > order and updating them one-by-one (sometimes one row twice) to reflect
> > current state. The problem is, that this generates an enormous amount of
> > tuples in that table.
> 
> Sounds like you have an application design problem ...  how about re-writing 
> your function so it's a little more sensible?

Also, you could at least use a temp table for intermediate steps. This
will at least save WAL traffic.

-- 
Hannu Krosing <hannu@tm.ee>



view thread (12+ messages)

Message-ID: <1111094845.6281.1.camel@fuji.krosing.net>
Permalink:  ../1111094845.6281.1.camel@fuji.krosing.net/
Also on:    postgresql.org/message-id/1111094845.6281.1.camel@fuji.krosing.net

 · 

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: hannu@tm.ee, josh@agliodbs.com, t.matiisen@aprote.ee
  Subject: Re: One tuple per transaction
  In-Reply-To: <1111094845.6281.1.camel@fuji.krosing.net>

* 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