
It won't record execution plans so if you're reviewing a profiler log from a customer's system on your own system there is no way of determining what execution plan SQL Server used when it was executed.ĭon't get me wrong: SQL Server profiler is an invaluable tool that I use on almost a daily basis, but there are some things it won't do that I would want it to. It requires access to and privileges on the database server which is not always available in hosted environments, or in locked-down customer environments. It can't be controlled from within applications, and it requires the person using it to know what they're looking for.
Sql server profiler 17 code#
In a large application with many developers involved this can make it time consuming to determine another important aspect who's code is responsible for hitting the database too frequently, or with too heavy queries, etc.Īdd to that that SQL Server Profiler is made for DBAs, sys-admins, developers, and must be manually set up in a production environment.

But a missing part is the application side of it: where did that query come from, what led to it being executed etc. It is built as a generic tool for all kinds of SQL Server profiling - not only queries but targeting other kinds of database activity as well. To take this a step further, I have decided to throw a new tool onto the stack for L2S developers: a brand new profiler specifically targeting Linq-to-SQL applications.īut before we take a look at the L2S Profiler, a brief look at what comes out-of-the-box with SQL Server and Linq-to-SQL, and then what the L2S Profiler brings to the table compared to the existing tool stack.Īlthough SQL Server Profiler goes a long way when it comes to pinpointing what queries are causing the most stress db-side, it provides information from the SQL Server side of things only. Linq-to-SQL has a built in logging feature that allows executed queries to be written to log files by simply attaching a textwriter to the datacontext object.SQL Server Profiler is a really great tool that comes with the management tools for SQL Server (Standard edition and up, unfortunately it not available in Express edition).The Microsoft tool stack offer some nice stuff for Linq-to-SQL and SQL Server based apps: There are many great tools available for investigating database performance at runtime / in production environments. SQL Server will often execute queries differently on different systems depending on data volumes, available resources, system load, system and db configuration, and many other factors.īecause of this, runtime profiling live production systems can sometimes reveal bottlenecks and/or room for improvements/optimization that would not show up during development/test/QA, or on dev/test systems.Applications are often used different in a production environment than what developers and designers envisioned users may refresh 'screen x' twice as often as was envisioned during design and development, or use search filters in search screen differently than anyone thought.

As the number of users in a large system grow, the impact of query costs - and savings of reducing it - is often the single most important factor to look at to improve performance and scalability, and the cheapest way to improve scalability.Īdditionally, a production environment will often differ from test/development in ways that can affect how queries behave: If a certain operation spends a bit more time, CPU, and other resources client side it is often not as big of a matter scalability-wise as if it spends time or resources database-side/server-side. When developing database driven applications - especially apps with many users and different usage patterns - database performance is key to application performance and the database is often the 'resource bottleneck' when it comes to scaling applications to cope with a larger number of users.
