Portal Engine Questions on portal engine and web parts.
Version 4.x > Portal Engine > How to check Custom Sql query performance through Kentico Framework View modes: 
User avatar
Member
Member
kartarbidhuri-gmail - 7/26/2012 8:29:30 AM
   
How to check Custom Sql query performance through Kentico Framework
I am working on Kentico Framework 5.5
I want to know below points about Kentico Framework :

1) Suppose I have created any custom table in my application and now I am using sql queries to fetch data from it .Now I want to know can I see its execution plan through Kentico framework and how ?


2) Sql query or Stored procedure which will give better performance on insert / Select data from custom table ? And how can I Evaluate this .
Is there any feature available in Kentico Framework for this?

Code sample :

var cn = ConnectionHelper.GetConnection();
var parameters = new object[2, 3];

parameters[0, 0] = "@SiteID";
parameters[0, 1] = CMSContext.CurrentSiteID;
parameters[1, 0] = "@SiteCodeName";
parameters[1, 1] = CMSContext.CurrentSiteName;

var ds = cn.ExecuteQuery("MyCustomTable", parameters);


Note : I used debug option which is available in kentico framework but I was getting only execution time of framework query not my query .If there is any other setting required please let me know.

User avatar
Kentico Developer
Kentico Developer
kentico_helenag - 7/28/2012 3:10:09 AM
   
RE:How to check Custom Sql query performance through Kentico Framework
Hello,


You can use the SQL queries debug: SQL queries debugging for queries which are executed by Kentico. You can use CMS.SettingsProvider.SqlHelperClass namespace to execute custom queries (see the API Reference for more details).

You can register queries and stored procedures in Site manager -> Development -> Document types -> edit Root -> Queries -> add a new one. It doesn't need to be related to document types, it will be only stored there.

You can also use the standard ASP.NET tools since Kentico is a standard ASP.NET application.


Best regards,
Helena Grulichova