Re: What's faster? - Mailing list pgsql-performance

From Tom Lane
Subject Re: What's faster?
Date
Msg-id 9344.1072497603@sss.pgh.pa.us
Whole thread Raw
In response to Re: What's faster?  (Mike Nolan <nolan@gw.tssi.com>)
List pgsql-performance
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

pgsql-performance by date:

Previous
From: Mike Nolan
Date:
Subject: Re: What's faster?
Next
From: "D'Arcy J.M. Cain"
Date:
Subject: Re: What's faster?