pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Jim C. Nasby <decibel@decibel.org>
To: pgsql-admin <pgsql-admin@postgresql.org>
Subject: Re: cost of empty fields
Date: Fri, 15 Apr 2005 11:58:02 -0500
Message-ID: <20050415165802.GT58835@decibel.org> (raw)
In-Reply-To: <20050415142206.GA347@nibiru.borg.metux.de>
References: <20050415142206.GA347@nibiru.borg.metux.de>

If you setup rules on the view and just have the application select,
insert, update, and delete from the view instead of the raw tables you
won't need to change your application at all. Though you do need to be
aware that you can't easily enforce uniqueness across multiple tables.

As for clearing the fields, if by clearing you mean setting to NULL then
you're correct, it would save space. Just remember that you won't
actually be able to use the saved space until the table is vacuumed.

On Fri, Apr 15, 2005 at 04:22:07PM +0200, Enrico Weigelt wrote:
> 
> Hi folks,
> 
> 
> we've got an quite large table with 17 columns and now >15k rows.
> The table works also as an journal will continously grow day by day. 
> Man of the columns (mostly text) aren't needed anymore if the tuple 
> has reached a certain age. 
> So I thought about clearing the unnecessary fields of old tuples 
> to save resources. Does it bring any performance improvement ?
> 
> Of I could splitt off this table an working- an archive- table 
> and map them together in some views - someday I probably *will* 
> do it - but our applications are not yet ready for this.
> 
> 
> thx
> -- 
> ---------------------------------------------------------------------
>  Enrico Weigelt    ==   metux IT service
> 
>   phone:     +49 36207 519931         www:       http://www.metux.de/
>   fax:       +49 36207 519932         email:     contact@metux.de
>   cellphone: +49 174 7066481
> ---------------------------------------------------------------------
>  -- DSL ab 0 Euro. -- statische IP -- UUCP -- Hosting -- Webshops --
> ---------------------------------------------------------------------
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Don't 'kill -9' the postmaster
> 

-- 
Jim C. Nasby, Database Consultant               decibel@decibel.org 
Give your computer some brain candy! www.distributed.net Team #1828

Windows: "Where do you want to go today?"
Linux: "Where do you want to go tomorrow?"
FreeBSD: "Are you guys coming, or what?"



view thread (4+ messages)  latest in thread

Message-ID: <20050415165802.GT58835@decibel.org>
Permalink:  ../20050415165802.GT58835@decibel.org/
Also on:    postgresql.org/message-id/20050415165802.GT58835@decibel.org

 · 

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-admin@postgresql.org
  Cc: decibel@decibel.org
  Subject: Re: cost of empty fields
  In-Reply-To: <20050415165802.GT58835@decibel.org>
  References: <20050415142206.GA347@nibiru.borg.metux.de> <20050415165802.GT58835@decibel.org>

* 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