Search Postgresql Archives

Re: View vs Constantly Updated Table

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> How often are you using the "bank balance" value?
I have no data on this as of yet, but it obviously needs to be correct for when the user looks at it.

> The opposite argument, is how long does the computation take?
The computation is simple, however the amount of data that goes into it grows as there are more and more transactions added. This is why I was thinking of storing the balance in a table sort of as a cache to avoid spinning through all pas transaction to get the current balance.

> and how quickly do you need it?
  as fast as possible of course :)

> Also, if you would be taking any
action with the value returned by the balance calculation, remember to
lock any tables necessary to ensure the balance doesn't change between
the time you compute it and the time you act on it.

I'll keep this in mind. never done a lot of manual locking before, but I can see where this is going to be needed. Its possible to take row locks and not complete table locks correct? (manual chapter 13.3) I'm thinking if I use a single table to hold all users cached balances then I would not want to lock the entire table just to retrieve and act on one users balance.

thanks for the input

On Dec 15, 2008, at 11:27 AM, Adam Rich wrote:

Truncated...

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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux