Contents tagged with Performance

  • Getting the read/write ratio for a database

    EDIT: Please also see in depth comment from Brent Ozar on my main site which extends the query provided below by adding extra columns to give the data more context and general advice when interpreting this type of data.

    Just a quick post this time. Recently I needed to find out the read/write ratio for some of our customer databases as part of a bigger project of understanding the workload and performance of the databases. The project actually through up a few surprises, where databases that I …

  • Script to analyse space usage by your Service Broker

    I believe that service broker is one of the best features from SQL server 2005, well along with the xml data type, and I use service broker a lot for messaging between solutions. Over the years it has proven to be extremely reliable; only really stopping because of a poison message or other environment type issue outside the control of the broker.

    Service broker itself uses a number of internal tables which it uses to store details regarding conversations and routing, and there are also any …

  • Revised: Difference between collation SQL_Latin1_General_CP1_CI_AS and Latin1_General_CI_AS

    This is a revised post of an original article that I first published in December. Even though I thought that I was very meticulous in my research, something was pointed out to me that I was totally unaware of - Unicode character expansions. So apologies to the community with regard the first article that I published as some of the original content could have been misleading. Here is a new revised article that explains character expansions and how it can affect the comparison of data with these …

  • Convert comma separated string to table and vice versa

    I know that this subject has been blogged about numerous times but I thought I'd post an alternative way of shredding a comma separated string to a table that I come up with today, albeit with help from the very clever Itzik Ban-Gan cross join nested CTE that many of us use to generate large tally tables quickly.

    For sure, in the ideal world we wouldn't have to do this as there isn't an easy and efficient way to do this in T-SQL. There are much better ways of passing this type of data to the …

  • Simple XML exist performance enhancement

    I came across this really simple best practice from BOL for the xml method exist which when used will give you a much cleaner and faster query plan. If like me you commonly use the name of an element or attribute as part of an XQuery predicate, then you would benefit immediately from this.

    So lets create a table with a single blob of xml and try out two queries to show this in action. The full script can be downloaded from here


    --Create example table



    Id INT …