dimanche 1 février 2015

index of aggregate value with fast update?


Is it possible for me to index the sum of a particular table column, such that future lookups will not have to scan the entire table? This table will grow to be very large and a sum of the entire table at once could be quite costly.


And just as importantly, can I trigger future INSERT|UPDATE|DELETEs to update the sum without re-adding every term? (For example, an INSERT should add the relevant column's value from the new row to the existing sum.)


Will materialized views help with this goal? This SO question seems to suggest that they will, but I'm not sure how.





Aucun commentaire:

Enregistrer un commentaire