O'Reilly logo

Entity Framework Core Cookbook - Second Edition by Ricardo Peres

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Testing and profiling queries

Sometimes, a query doesn't behave as expected: it either doesn't return what it should or takes longer than desired. When this happens, you need to profile it.

We will talk about four options to test profile your queries:

  • Adding logging
  • Using a profiler connected to the database to monitor executing queries
  • Adding a diagnostics package to monitor your app in real time
  • Using a tool to dynamically perform queries and see their results

How to do it…

The next sections will cover tools that will help you in watching the output, measuring the performance, and debugging your queries.

Logging

You have a couple of options when it comes to profiling; first, it is usually helpful to look at the SQL that is being sent to the database. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required