Slower queries and hanging

(5 posts) (2 voices)

Tags:

No tags yet.

  1. elb98rm, Member

    Hi,

    I've been working on some reports that take a fair amount of time to return due to some complicated database calculation.

    The SP I am using actually calls a number of views, and including all the formatting calls, returns over 40 select statements.

    The report would render in MyDBR in 2-3 sections.

    I've recently had problems with this as this tho, as it seems to hang permanently after the first return has happened.
    When I run the report in MySQL workbench, the total calculation time for all stages of the view are about 60s/75s... but critically - it does return and with correct data.

    The MyDBR report half renders with correct data, but if you wait for the remaining selects to return (and track them in MyDBR management), MyDBR does not update.

    To my understanding, no code has changed and this has only recently become a problem.

    The data set will have increased a little, so my theory is that I'm hitting a timeout somewhere (perhaps php). Do you have any suggestions on how to troubleshoot this?

    Cheers
    Rick

  2. myDBR Team, Key Master

    The MyDBR report half renders with correct data, but if you wait for the remaining selects to return (and track them in MyDBR management), MyDBR does not update.

    What do you mean by "myDBR does not update"? Do you mean the original report or the subsequent queries when the report is being run?

    myDBR speed should be very close to MySQL workbench speed when executing the procedure. Only when you return large amounts of data (thousands of rows), the browser may slow things bit when rendering the HTML.

    By default myDBR keeps the PHP session open in order to serve the images. If you have a slow report, it need to finish first. If you use embedded images in the report, the session is closed before the report is run. You can use SVG format for charts as well for nicer looking charts. Just add following two lined into user/defaults.php.

    $mydbr_defaults['chart']['embed_image'] = true;
    $mydbr_defaults['chart']['default_image_format'] = 'svg';

    --
    myDBR Team

  3. elb98rm, Member

    The report is text only.
    It's a cross tabulated report of approximately 1000 rows.

    To be clear about the "not updating" problem..

    MySQL workbench chugs along and after 30s returns the first set. A further 30s later it returns the second data set. Approximately 30 later it returns the final set.

    MyDBR behaves as follows:

    The header bar renders.
    Approximately 30s later an almost complete table renders (main results set 1).
    However, the second results set never renders, and the page just hangs there.

    If you follow the processes in MySQL Workbench, they complete as expected. MyDBR doesn't seem to respond to them... This is why I'm suggesting it could be a timeout error of some sort.

  4. myDBR Team, Key Master

    Being text only does not really matter as the decision whether to keep the session open is done prior myDBR has knowledge if the report contains charts.

    It sounds like though that your PHP timeout kicks in. Check the timeout (max_execution_time) settings in php.ini.

    --
    myDBR Team

  5. elb98rm, Member

    Great. I'll need to get access from sysadmin, so will report back when I get it.

    Cheers
    Rick


Reply

You must log in to post.