SQL queries debug

  Previous topic Next topic JavaScript is required for the print function Mail us feedback on this topic! Mail us feedback on this topic!  

SQL queries debugging can be turned on by adding one or more of the following keys to AppSettings section of your project's web.config file:

 

CMSDebugSQLQueries - enables the SQL queries tab in Site Manager -> Administration -> System -> Debug
CMSDebugSQLQueriesLive - enables SQL queries debugging on the live site
CMSDebugAllSQLQueries - enables debugging of all SQL queries (including the UI)
CMSDebugSQLQueriesLogLength - maximal length of the SQL queries debug log (number of preserved records)
CMSLogSQLQueries - if applied, SQL queries debug log will be saved into ~/App_Data/logsql.log

 

Here is a list of these keys for easy copy&paste into your web.config:

 

<add key="CMSDebugSQLQueries" value="true" />

<add key="CMSDebugSQLQueriesLive" value="true" />

<add key="CMSDebugAllSQLQueries" value="true" />

<add key="CMSDebugSQLQueriesLogLength" value="10" />

<add key="CMSLogSQLQueries" value="true" />

 

SQL queries debugging can also be enabled using the bulk keys.

 

User interface

 

On the Debug -> SQL queries tab, you can see a log of SQL queries called on loading of particular pages. For each record, there is row with a URL of the loaded page followed by its time of display. Below it, you can find a table listing all SQL queries executed when loading the page.

 

For each query, there are two lines in the table. The first line contains the exact text of the query, while the second line contains the number of loaded rows, columns in each row and the size of the loaded data. The Context column shows where the query was called from. The last column of the table displays the exact duration of query execution. The last line of the table displays the overall page loading time.

 

Clicking the Clear SQL log button clears all records in this debug log.

 

devguide_clip0371

 

Page url: http://devnet.kentico.com/docs/5_5r2/devguide/index.html?sql_queries_debugging.htm