Login / Register  search  syndication  about

          Ryan Farley's Blog

Ryan Farley on .NET Development with a focus on CRM Development for SalesLogix

Prepared Queries and the SalesLogix Provider

If you have not yet read Stuart Carnie's article on slxdeveloper.com on using prepared queries with the SalesLogix provider than I highly recommend you check it out (See: The Myths and Legends of Prepared Queries). Stuart recently offered some comments to the article which provided some background on the provider in regards to trips to the server as well as other significant changes which result in big performance gains.

[...]6.1 always did a prepare before executing the statement. The main reason for removing this was scalability and performance. The load (both network and CPU) and memory usage on MSSQL is significantly greater than what is in 6.2, and preparing the query was a major contributing factor. Some early tests running my inhouse load testing tool showed a significant delta of memory usage for the sqlservr.exe process. 6.2 was about 65mb and 6.1.0 was about 240mb.

Round trips to the SQL server are also massively impacted. Almost always (after internal meta-data is cached), 6.2 performs 1 round trip to the server to execute the query, 6.1x performs 3, and depending on how the ADO recordset is used (i.e. if it is prepared and the executed), possibly even 5 round trips! Typically a 3 way is a 1:PREPARE, 2:EXECUTE, 3:UNPREPARE, a 5 is a 1:PREPARE, 2:UNPREPARE, 3:PREPARE, 4:EXECUTE, 5:UNPREPARE. This was largely to do with the SDK we used in 6.1x - 6.2 removed the SDK completely.

In a disconnected model, prepares rarely make any sense. Given our client is now disconnected, and ADO.NET is also a disconnected model, a prepare (by the SalesLogix provider) is even more unnecessary.

[...]Very rarely should code need to do a 'true' prepare. We have been working on this internally for 3+ years and have seen all the variations in performance. The balance we reached in 6.2 is the best for the SalesLogix application environment, including ADO.NET for how our developers including BPs typically use it.

[...T]he 6.2 provider truelly prepares the query in it's internal buffers, so it only parses, allocates parameter binding buffers and many other expensive internal structures once. The 6.1x provider (due to the 3rd party SDK we used) does all these steps EVERY time.

[...]Given the above query in the example is static, and only the parameter values change, SQL server caches the query anyway, and so the performance difference between doing a true PREPARE, EXECUTE..EXECUTE..EXECUTE, UNPREPARE is not worth the difference.

[See Stuart's full comments]

What's This?
  
Bookmark and Share

About Ryan Farley

   Ryan Farley is the Director of Development for Customer FX Corporation and the creator of slxdeveloper.com.

Don't miss these developer series from Ryan:


Related Content
   Introducing the SalesLogix Mobile Developer Toolkit
I am very pleased to announce a new & free open source tool from Customer FX named the SalesLogix Mob
Posted on Nov 13, 2012 by Ryan Farley to Ryan Farley's Blog
 
   Passing Connection Information from SalesLogix Web to Another Website
When integrating another system, application, or website with SalesLogix there are many options. If you&#
Posted on Dec 22, 2011 by Ryan Farley to Ryan Farley's Blog
 
   Extending Sublogix Entities
If you've followed my posts on Sublogix, or even better, given Sublogix a spin, you'll know that
Posted on Nov 15, 2011 by Ryan Farley to Ryan Farley's Blog
 
   Modifying the QuickFind Lookup in the SalesLogix LAN client
The Quick Find functionality in the SalesLogix web client is a fast and easy way to look up information f
Posted on Nov 02, 2011 by Jason Buss to Jason Buss' Blog
 
   Creating SalesLogix .NET Extensions with the .NET Extensions Helper Library
A couple of weeks ago I announced the .NET Extensions Helper open source library. I figured it was time f
Posted on Oct 27, 2011 by Ryan Farley to Ryan Farley's Blog
 
Comments

No Comments

Leave a Comment

(required)  
(optional)
(required)  
Add
All contents Copyright © 2013 Customer FX Corporation
Customer FX Corporation
2324 University Avenue West, Suite 115
Saint Paul, Minnesota 55114
Tel: 800.728.5783

  Follow @CustomerFX on twitter
Follow the best news, tips, and articles
  Subscribe to Customer FX on youtube
Watch SalesLogix tutorial videos from Customer FX
Login / Register