database - Query retrieving vs. calculus - best performance? -
i have doubt, best, in term of performance, retrieving large database (50k+ rows growing) on mysql "calculated" data or perform calculus on fly?
the calculus division , multiplication of data yet retrieved db, lot of data (minimum ~300 calculus per load).
another note, "page" can loaded multiple times (it's not one-load).
i think calculate value (e.g. using background task) , retrieving db best solution in term of performance, right?
there lot of difference in 2 approach?
i'd play strengths of each system.
aggregating, joining , filtering logic belongs on data layer. it's faster, not because db engines have 10+ years of optimisation doing that, minimise data shifted between db , web server.
on other hand, db platforms i've used have poor functionality working individual values. things likes date formatting , string manipulation suck in sql, you're better doing work in php.
basically, use each system it's built do.
in terms of maintainability, long division between happens clear, separating these types of logic shouldn't cause problem , not enough out way benefits. in opinion code clarity , maintainability more consistency putting logic in 1 place.
to sum up: i'll defenetly use database problem.
Comments
Post a Comment