mysql - dynamic or pre calculate data -
a bit new programming , had general question thought of.
say, have database bunch of stock information , 1 column price , earnings. price/earning ratio, better calculate everyday or calculate on demand? think performance wise, it'd quicker read i'm wondering if math type functions worth batch job pre-calculate it(is noticeable?).
so how professionals it? have application process data them or have available in database?
the professionals use variety of methods. depends on you're going for. new real ratios need displayed immediately? how core data changing? ideally calculate ratio time price or earning changes, takes development, , it's not worth if don't have substantial amount of activity on site.
on other hand, if you're receiving hundreds of visits every minute, you're going want cache whatever you're calculating, time required re-display cached result less recreating result (in scenarios).
however, general rule of thumb, don't stuck trying optimize haven't anticipated performance issues with.
Comments
Post a Comment