Retrace will reach End of Life on March 31, 2027. Click here to learn more.

Prefix vs Glimpse: SQL Queries

By: mwatson
  |  March 15, 2016
Prefix vs Glimpse: SQL Queries

This article is meant to illustrate a high-level comparison of how Prefix and Glimpse track SQL queries. While the two tools are similar (they’re both designed to help us understand different elements of our code’s performance) the two products have some unique pros and cons. Here’s a comparison based on our own experience with both tools.

How to enable Glimpse for SQL queries

Glimpse requires you to install various extensions via nuGet packages to support different providers. For example, there are packages for ADO, Entity Framework 5, 6, and potentially others.

To download Glimpse visit: http://getglimpse.com/

First try: I started out trying to test a query that uses basic SqlConnection and SqlCommand objects, but I found out that doesn’t work at all, which is a huge shortcoming. You have to modify your code everywhere you use SqlConnection objects to create one through a special factory class. Yuck. Result: It doesn’t work with basic Sql Commands.

Second try: My favorite ORM right now has to be Dapper, and I’m not the only one. It has over 1 million downloads on NuGet. It is easy to use and extremely fast. Unfortunately, Glimpse neither supports Dapper automatically nor with a NuGet package.  It looks like the only solution is to use the factory provider to get the special SqlConnection object and then to use that with Dapper.  Result: Dapper works with special Glimpse connection object, just like my first try.

Third try: So I used the Entity Framework designed to pull all my database tables in so I could easily query them. On my first try to query with EF, I got this error: “Unable to cast object of type ‘Glimpse.Ado.AlternateType.GlimpseDbConnection’ to type ‘System.Data.SqlClient.SqlConnection’”. Installing package Glimpse.EF6 fixed this, and I was able to get EF working. Result: It worked with EF.

How to enable Prefix to track SQL queries

To download Prefix visit: https://stackify.com/prefix

The good news is you literally have to do nothing but install Prefix as a windows app on your PC. It works as a .NET profiler and therefore can automatically collect all of your SQL queries for SQL Server, Mysql, Postgresql, Oracle and others across multiple ORMs auto-magically.

Differences between Prefix & Glimpse

Overall, they both accomplish the same goal of letting you see which SQL queries your code just executed. Glimpse shows them in the “SQL” tab. Prefix shows them more inline with the rest of the key methods it tracks. Both work with async database calls.

Glimpse:

glimpse 1

 

Prefix:

One key difference is that Prefix can show you how long it took to execute the query versus fully iterating the results. You can see this where it shows “Download Query Result”. I wrote an entire blog post on this topic: How to measure real world SQL performance for ASP.NET

prefix 1

The winner? Prefix.

Prefix wins hands down due to how easy it is to install and the wide support it has. Basic Sql Commands, EF, Dapper, and others work with Prefix with ZERO code or config changes. Glimpse doesn’t support the most basic of SqlCommand objects and requires separate NuGet packages for the ORMs it does support. The way it abstracts the SqlConnection and SqlCommand objects can also cause some other weird problems with apps. Prefix also gets big brownie points for showing how long it takes to even initialize Entity Framework and download the entire query result.

You can use Prefix and Glimpse at the same time. They don’t interfere with each other.

Download Prefix for free now

Improve Your Code with Retrace APM

Stackify's APM tools are used by thousands of .NET, Java, PHP, Node.js, Python, & Ruby developers all over the world.
Explore Retrace's product features to learn more.

Learn More
situs toto pucuk4d indobet toto slot slot depo 10k 8kuda4d toto toto toto bobatoto daftar logototo situs toto situs toto toto patentoto situs toto slot 4D situs toto toto ilmutoto bayitoto mawar800 login popotogel prize hongkong malam ini toto joker11 lingkartoto depo 5k panen100 semibola popo togel https://asupantoto.co/ slot pascol4d login pascol4d login sbobet88 sbobet88 https://nolimithoki.dev/ dinasti33 slot slot88 slot jepang slot depo 5k pucuk4d https://www.juara288.asia/ slot 4d RP888 toto toto pascol4d situs toto kari4d flokitoto slot gacor logototo slot depo 5k bobatoto bobatoto bobatoto sontogel mpo slot situs toto slot situs slot nobu99 logototo logototo logototo logototo logototo logototo logototo logototo logototo logototo logototo logototo logototo logototo logototo logototo logototo logototo logototo logototo logototo bobatoto istanaslot rp888 www.pajaktoto.io kari4d kari4d kari4d kari4d pascol4d pascol4d pascol4d toto slot slot gacor bento11 link KARI4D PUCUK4D pascol4d situs slot toto slot titi4d slot gacor toto toto slot toto jinhoki situs slot situs slot situs slot AMANAHTOTO https://www.asupan188.dev/ slot gacor gampang menang toto slot gacor bwo303 situs toto toto slot slot gacor slot88 slot gacor situs slot link slot situs toto MySlot188 SlotPoker188 slot gacor slot gacor pucuk4d PASCOL4D situs slot link slot pentaslot SLOT GACOR AMANAHTOTO TOTO 4D pajaktoto slotvip toto togel situs toto toto slot situs slot situs slot situs slot toto slot gacor slot777 toto slot slot gacor situs slot link slot slot thailand patentoto situs judi bola situs toto roma77 slot jpmania toto228 RATU89 RUSIA777 slot gacor POPOTOGEL : Situs Resmi Bandar Toto Togel Macau dengan Prediksi Gokil Pasti Akurat PARLAY slot gacor slot gacor slot gacor link slot BUNGASLOT slot slot gacor situs slot slot gacor slot gacor sejukbos situs slot link slot slot gacor gacor gacor Slot88 Slot88 coloktoto toto slot slot gacor situs slot gacor situs toto slot gacor toto toto toto slot gacor slot88 slot777 slot pulsa ayamtoto StreamEast slot777 slot88 link slot gacor situs gacor slot gacor slot gacor toto slot slot gacor leon188 slot gacor bandarqq jpmania slot gacor slot gacor Slot88 https://ini777gold.com nenek188 slot gacor slot gacor slot gacor NKRISLOT Slot88 situs slot slot gacor
situs toto pucuk4d indobet toto slot slot depo 10k 8kuda4d toto toto toto bobatoto daftar logototo situs toto situs toto toto patentoto situs toto slot 4D situs toto toto ilmutoto bayitoto mawar800 login popotogel prize hongkong malam ini toto joker11 lingkartoto depo 5k panen100 semibola popo togel https://asupantoto.co/ slot pascol4d login pascol4d login sbobet88 sbobet88 https://nolimithoki.dev/ dinasti33 slot slot88 slot jepang slot depo 5k pucuk4d https://www.juara288.asia/ slot 4d RP888 toto toto pascol4d situs toto kari4d flokitoto slot gacor logototo slot depo 5k bobatoto bobatoto bobatoto sontogel mpo slot situs toto slot situs slot nobu99 logototo logototo logototo logototo logototo logototo logototo logototo logototo logototo logototo logototo logototo logototo logototo logototo logototo logototo logototo logototo logototo bobatoto istanaslot rp888 www.pajaktoto.io kari4d kari4d kari4d kari4d pascol4d pascol4d pascol4d toto slot slot gacor bento11 link KARI4D PUCUK4D pascol4d situs slot toto slot titi4d slot gacor toto toto slot toto jinhoki situs slot situs slot situs slot AMANAHTOTO https://www.asupan188.dev/ slot gacor gampang menang toto slot gacor bwo303 situs toto toto slot slot gacor slot88 slot gacor situs slot link slot situs toto MySlot188 SlotPoker188 slot gacor slot gacor pucuk4d PASCOL4D situs slot link slot pentaslot SLOT GACOR AMANAHTOTO TOTO 4D pajaktoto slotvip toto togel situs toto toto slot situs slot situs slot situs slot toto slot gacor slot777 toto slot slot gacor situs slot link slot slot thailand patentoto situs judi bola situs toto roma77 slot jpmania toto228 RATU89 RUSIA777 slot gacor POPOTOGEL : Situs Resmi Bandar Toto Togel Macau dengan Prediksi Gokil Pasti Akurat PARLAY slot gacor slot gacor slot gacor link slot BUNGASLOT slot slot gacor situs slot slot gacor slot gacor sejukbos situs slot link slot slot gacor gacor gacor Slot88 Slot88 coloktoto toto slot slot gacor situs slot gacor situs toto slot gacor toto toto toto slot gacor slot88 slot777 slot pulsa ayamtoto StreamEast slot777 slot88 link slot gacor situs gacor slot gacor slot gacor toto slot slot gacor leon188 slot gacor bandarqq jpmania slot gacor slot gacor Slot88 https://ini777gold.com nenek188 slot gacor slot gacor slot gacor NKRISLOT Slot88 situs slot slot gacor