mysql - Recurring data demand - automated query, or store data directly in SQL? -



mysql - Recurring data demand - automated query, or store data directly in SQL? -

this simple question though title sounds complicated.

let's i'm storing info bunch of applications 1 central database/ info warehouse. info @ pretty fine level -- say, daily summaries of various metrics.

however, know in front-end displaying weekly , monthly aggregates of info well.

one thought have scripting language me after querying sql database - seems horribly inefficient, perhaps.

the sec thought have views in database represent business weeks , months -- might best way it.

but final thought -- couldn't sql client run query aggregates daily info weeks (or months) , store them in separate table? advantage of cut down querying time of user, since query work done before website or button loaded/ pushed. view, guess aggregation calculation have done view queried.

the downside having queries aggregated weeks/ months perhaps 1 time day (instead of every time website loaded) -- won't up-to-date/ may reflect inconsistencies.

i'm not expert when comes bigger image stuff -- have thoughts? thanks

it depends on user experience you're trying create.

is user base of operations expecting watch monthly aggregates 1 finger on f5 key when watching month's statistics? cover scenario, might want have view criteria presents window relative getdate(). keeping in mind indexing strategies , query design should mitigate impact of sort of approach nothing.

is user expecting informational info doesn't include today's data? more performance might seen out of nightly job aggregation new table.

of scenarios, though, not recommend manual aggregation. downwards road unexpected bugs , exceptions can handled sql statement. aggregates big part of dbmss', allow software handle , work on rest of application.

mysql sql reporting aggregation

Comments

Popular posts from this blog

Delphi change the assembly code of a running process -

json - Hibernate and Jackson (java.lang.IllegalStateException: Cannot call sendError() after the response has been committed) -

C++ 11 "class" keyword -