Subject | it's possible to have a view cache? |
---|---|
Author | korkless |
Post date | 2010-01-11T13:51:01Z |
hi all, i'm newbie to databases so sorry if this is a stupid question :)
i have a table where the records are read-only and where new rows are added by a service with a single connection/transaction (so using a trigger on update it's not very good for my purpose).
then i have a view (but maybe there's a better solution for my needs)
which contains the results of same calculations made on the values of my table (at the moment i don't know if i can do that calcolous with sql, for example with a store procedure, or if i need to use an UDF).
i don't know very well how a view works but it seems that is not cached, so every time that i do a select on the my view all the data is reed again from the original table, so for example if i have a column in the view that contains count(*) it will be revaluated on every select.
my idea is to have samething as a cache of the view wich will be reloaded only when the original table is updated (i mean when the transaction that had updated the table has been commited, not on the insertion of every single new row), otherwise it will contains the static results of the calcolous based on the values of the table.
what do you suggest?
i have a table where the records are read-only and where new rows are added by a service with a single connection/transaction (so using a trigger on update it's not very good for my purpose).
then i have a view (but maybe there's a better solution for my needs)
which contains the results of same calculations made on the values of my table (at the moment i don't know if i can do that calcolous with sql, for example with a store procedure, or if i need to use an UDF).
i don't know very well how a view works but it seems that is not cached, so every time that i do a select on the my view all the data is reed again from the original table, so for example if i have a column in the view that contains count(*) it will be revaluated on every select.
my idea is to have samething as a cache of the view wich will be reloaded only when the original table is updated (i mean when the transaction that had updated the table has been commited, not on the insertion of every single new row), otherwise it will contains the static results of the calcolous based on the values of the table.
what do you suggest?