KoolReport's Forum

Official Support Area, Q&As, Discussions, Suggestions and Bug reports.
Forum's Guidelines

Why a query take too long only in Koolreport? #2683

Open Joaquin Duro opened this topic on on May 18, 2022 - 3 comments

Joaquin Duro commented on May 18, 2022

Hello, I am using Koolreport to get some graphics. It is working well in general, but I am facing an "error" I cannot understand. I have a MySQL query which takes around 1s 547ms executing it on phpMyAdmin or PhpStorm console. But making same query with Koolreport takes around 15/16 seconds. I am using MySQLDataSource, and debugging with Xdebug I found that is on this line where it get "stuck":

"$stmt->execute()" is where most time is "wasted", so it looks like the problem is on query executing, not drawing graphic or whatelse. I have checked that is the same query, so I cannot find a reason why through Koolreport it takes several seconds and "directly to database" it takes less than 2 seconds.

Thank you.

Sebastian Morales commented on May 21, 2022

How many parameters are there in your query? Is there any array parameter and how many values does it have? KoolReport has to convert an array parameter into a list of parameters to bind. Anyway, your source code looks like an old version of KoolReport. Is there any change you update to the latest or a newer version to see if it improves query speed? Rgds,

Joaquin Duro commented on May 23, 2022

Hello, thank you for your answer.

The query has no parameters, in the Koolreport file I have some condition so query finally is just a string (it is because depending on some values, the query has a different structure), so no parameters used through Koolreport. I am using Koolreport 5.5.0. I will try update, but I have found that it is slow executing at Azure environment, in my local machine goes fast, do you know something about it? Maybe I should check some configurations. I will keep trying.

Thank you.

Sebastian Morales commented on May 23, 2022

Can you execute the final sql query on your Azure's sql console or studio to see its returning time? You can't really compare your local DB sql executing time with KoolReport's sql executing time on Azure environment.

Build Your Excellent Data Report

Let KoolReport help you to make great reports. It's free & open-source released under MIT license.

Download KoolReport View demo
help needed

None