I’am having 6 reports in my web application. All the reports using huge queries around 15 table joins and also query results looping again to do some calculations before present the report to user.
This take long time to load a report. I am using MySQL with Java
What is the best way to fix this issue?
- If caching is good what are the available options for that?
- I’am planing to create a table and insert all the required data to that table, then reports can access to that table, if it’s possible what is the best way to load data to that table?
- Can MongoDb or other NoSql DB fix this issue?
- Or is there any standard way to do these kind of things?
Use an
Explainin front of your query and figure out if yourJoinsare using any indexes. Hopefully you are usually joining your tables in a similar way, so if you add the right indexes, it should speed it up quite a bit.For example, if you had,
You would want to add an index to the
colorcolumn in thefruitstable, and an index to theweightcolumn of theveggiestable.