Note that there are some explanatory texts on larger screens.

plurals
  1. PODesign decision? 4 minute report... tying up the server
    primarykey
    data
    text
    <p>I have a few reports that are taking up to 4 minutes to run in my RoR application. Since then, my users are experiencing delays with their simple tasks in the systems where the system stops responding.</p> <p>I am still trying to look into the main cause of the issue to see if the reporting and the system-hangs are related. Does anyone have any advise on how I should go about restructing my report to it does not take 4 minutes to run?</p> <p>So far I have looked into running a background job every night that calculates all of the figures I want so the reporting times will be significantly decreased. I am yet to find a solution that may use middleware or in memory instances to derive reports instead of hitting the DB with a large query.</p> <p><strong>Technical info:</strong></p> <ul> <li>The VPS is running 384 MB of RAM (will an increase be a suficient work-around?)</li> <li>The reports are a combination of SQLs with some heavy ruby scripting to massage the contents so they are displayed in a readible fashion</li> <li>DB tables contain between 2,000 to 30,000 rows</li> </ul> <p><strong>Technical Report Info</strong></p> <ol> <li>DB-query-1 has 5 inner joins. It is run first to create a lookup hash</li> <li>DB-query-2 has 5 inner joins. It is run once and each record of its resultset is traversed</li> <li>For each record of (2.), DB-query-3 (containing 5 inner joins) is run</li> <li>For each record of (2.), the lookup hash from (1.) is traversed to perform some calculations</li> </ol> <p>From writing this through Anon's request of additional information I can already see the sting of a nested loop... </p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload