Query Performance
Last updated
Last updated
This page displays the query performance (if enabled) of each used server. It contains information about time (total, average, min, max, standard deviation), count, query type and SQL for each executed query / server. It helps developers to analyze if their application is generating problematic queries or if their database is not optimized for their application. poor query performance is the most common cause of poor application performance.
Query Performance settings can be found Servoy Admin interface: <host-name>/servoy-admin/database-performance
.
Statistics are grouped by database name:
In order to see statistics, click on the desired server name.
This shows the performance of ongoing queries (typically only problematic queries will be visible).
After clicking on the server name, the standard performance statistics page will be shown, displaying a table with the following statistics:
total time : Total Time is the time needed to execute the JDBC statement, the time to fetch the data from the database to the application server is also measured, this is included in the end-to-end time. This column's time might differ from one DBMS and JDBC driver to another.
average time : Avg Time is the time needed to execute the JDBC statement on average, the time to fetch the data from the database to the application server is also measured, this is included in the end-to-end time. This column's time might differ from one DBMS and JDBC driver to another.
count : how many times the query was executed
type : query type
action : SQL query itself
Average time and total count for each query are the most useful stats.
When clicking on Show advanced Performance Statistics.
, the table shows extra statistics:
Total (End-to-end) Time : total time, including the time taken by the read of the data
Avg (End-to-end) Time : average time, including the time taken by the read of the data
Min Time : minimum time that one execution of the query took
Max Time : maximum time that one execution of the query took
Standard Deviation : standard deviation of executions of this query; see standard deviation
Standard Deviation/Average : standard deviation divided by average time
Statistics can be cleared for each database, by clicking Clear Statistics.
.
Statistics can be exported for each database, by clicking Download as CSV.
.
The user can control the number of Performance entries by selecting one of the options available on top the Database Performance
page in Servoy Admin:
Disabled
Log only (goes straight to log, ideal for production if you still want this data)
500 max
Unlimited:
Servoy Provides special loggers that will log the performance directly to a file, this doesn't only work in Log Only (also for the admin page logging if that i enabled) For this you need to enhance the log4j.xml file that you use in production (or developer/application server if you want to test this in developer)
First in the loggers section of the log4x.xml file you need to add a Logger with the INFO level
the name is the logger where Servoy will output this to. It is a good thing to redirect this directly to its own file (and use additivity="false" to make sure it really only goes to that file) The Appender part is then creating its own output and uses async so the writing of the log is done in a seperate thread:
You can also add the client timing directly to the same file if needed or output that also to another file:
NOTE ServoyCloud has far more advanced query and database monitoring features, including machine learning analyses and AI.