pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Mike Nolan <nolan@gw.tssi.com>
Cc: kbottner@comcast.net
Cc: pgsql-performance@postgresql.org
Subject: Re: What's faster?
Date: Fri, 26 Dec 2003 23:00:03 -0500
Message-ID: <9344.1072497603@sss.pgh.pa.us> (raw)
In-Reply-To: <200312270106.hBR16MLg002310@gw.tssi.com>
References: <200312270106.hBR16MLg002310@gw.tssi.com>

Mike Nolan <nolan@gw.tssi.com> writes:
>> Because Postgres requires VACUUM ANALYZE more frequently on updated tables,
>> should I break this single field out into its own table, and if so what kind
>> of a speed up can I expect to achieve. I would be appreciative of any
>> guidance offered.

> Unless that field is part of the key, I wouldn't think that a vacuum 
> analyze would be needed, as the key distribution isn't changing. 

The "analyze" wouldn't matter ... but the "vacuum" would.  He needs to
get rid of the dead rows in a timely fashion.  The wider the rows, the
more disk space is at stake.

Also, if he has more than just a primary index on the main table,
the cost of updating the secondary indexes must be considered.
A balance-only table would presumably have just one index to update.

Against all this you have to weigh the cost of doing a join to get the
balance, so it's certainly not a no-brainer choice.  But I think it's
surely worth considering such a design.

			regards, tom lane



view thread (6+ messages)  latest in thread

Message-ID: <9344.1072497603@sss.pgh.pa.us>
Permalink:  ../9344.1072497603@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/9344.1072497603@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, nolan@gw.tssi.com, kbottner@comcast.net
  Subject: Re: What's faster?
  In-Reply-To: <9344.1072497603@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