EN
Free assessment

Expertise · SQL Server

SQL Server Consulting

iTask provides SQL Server consulting focused on performance: we read execution plans, review indexes, use Query Store to find regressions and remove deadlocks. The work happens on the live system, with measured and reversible changes, and starts with a free assessment.

SQL Server

Typical command line

SET STATISTICS IO, TIME ON;

When to use it

When SQL Server makes sense

  1. Screens and reports slow down at peak hours
  2. Deadlocks, timeouts or long blocking show up
  3. Server CPU is high and nobody knows which queries weigh most
  4. The database has grown and maintenance routines have not kept up

Architecture

The architecture we usually apply

Database with an SSDT project and versioned migrations, Query Store on, indexes reviewed by real usage, scheduled statistics and maintenance, snapshot isolation where it makes sense and queues to take heavy load off the transactional path.

iTask’s SQL Server consulting starts from one fact: a slow database is often treated as a server problem. In our experience, the problem is usually in the query, the index or the long transaction. That is why, before talking about hardware, we open Query Store.

We have maintained SQL Server systems for years, from an order system with an SSDT project to messaging platforms. The techniques below come from that work.

How we diagnose

Query Store. We turn on Query Store and let it collect for a few days of real traffic. For each query it keeps the plans used, duration, CPU and reads. It shows regressions: the same query that started using a worse plan after a statistics or version change.

Execution plans. We read the actual plan, and not only the estimated one. We look for table scans where a seek was expected, key lookups at high volume, row estimates far from the real count, spills to tempdb and expensive sort operators.

Wait statistics. Waits say where the server waits: disk, memory, locking, CPU. They separate a query problem from an infrastructure problem.

Index DMVs. Missing, unused and duplicate indexes come from dm_db_missing_index and dm_db_index_usage_stats. We treat the suggestions as a clue and not as an order. A suggested index may overlap another that already exists.

What we usually find

  • Non-sargable queries. A function on the filter column, implicit type conversion and LIKE with a leading wildcard prevent index use.
  • Parameter sniffing. A plan that is good for one parameter is terrible for another. We handle it with a rewrite, a targeted OPTION (RECOMPILE) or plan forcing through Query Store.
  • Indexes that are too wide. Unneeded columns bloat the index. We use included columns with judgment.
  • Long transactions. Holding a transaction open during an external call blocks other sessions and causes deadlocks.
  • OFFSET paging on large tables. Switch to keyset paging and latency becomes stable.
  • Reports on the transactional database. We move them to a read replica, an aggregate table or queue processing.

Deadlocks and blocking

We capture the deadlock graph with extended events. The most common pattern is two transactions that access the same tables in opposite order. The fixes, in order of preference:

  1. Always access tables in the same order.
  2. Shorten the transaction and remove any external call from it.
  3. Create the index that avoids the scan and reduces the set of locked rows.
  4. Use READ_COMMITTED_SNAPSHOT so readers do not block writers.
  5. Handle error 1205 with a retry in the application, because a rare deadlock is acceptable as long as the operation is idempotent.

Maintenance and growth

Index reorganization and rebuilds driven by fragmentation and size, and not by a blind calendar. Statistics updates on tables that change a lot. Partitioning and archiving when a log table grows beyond what maintenance can handle. A documented backup plan with restore testing.

Database as code

Every database object lives in an SSDT project or in versioned migrations. The pipeline applies changes to staging and production. This ends the cycle of loose scripts and differences between environments. In an order system served since 2018, this model gives every change an owner, a review and a history.

Working with a Brazilian team

Our engineers are based in Brazil, in time zones that overlap with the US working day, and we communicate in English.

How we deliver in weeks

  1. Our own boilerplates. Collection scripts, dashboards and maintenance routines are ready.
  2. AI agents with senior review. Agents help read plans, propose rewrites and generate tests. A senior engineer decides every change.
  3. The same team from assessment to deploy. The person who measures is the one who fixes.
  4. Fixed scope after the assessment. The free assessment lists the most expensive queries and the action plan, with a timeline in weeks.

A typical pattern

A typical pattern: a slow report screen. Query Store shows an implicit conversion between varchar and nvarchar on the filter column, which switches off index use. Once the parameter type is fixed and a composite index with included columns is created, the plan goes from a scan to a seek. The gain shows in logical reads and duration, and does not require changing servers. We measure both before and after the change and keep the result in the report we hand to your team.

What we deliver

A report with the most expensive queries, the plan for each and the proposed fix. Index scripts with tests and rollback. Performance alerts in your monitoring. A short training session so your team can read execution plans and use Query Store on its own.

After the fix, we leave a dashboard that shows the ten most expensive queries of the week. That way a regression appears before it becomes a complaint.

Database work goes hand in hand with .NET development and with the custom software development service. See the case Regina Festas, where a database routine confirms the score on the server. Request the free assessment of your database.

FAQ

Questions about SQL Server

Did not find your question? Write to us.

Where does a performance engagement start?

With metrics. We turn on Query Store, collect the most expensive queries by CPU, reads and duration and look at the plans. Only then do we propose an index or a rewrite.

Do more indexes make the database faster?

Not always. Every index speeds up reads and makes writes costlier. We remove duplicate and unused indexes and create only those the execution plan asks for.

How do you resolve deadlocks?

We capture the deadlock graph, find the access order that conflicts and adjust: consistent table order, shorter transactions, an index that avoids a scan and, when it fits, snapshot isolation.

Do you touch the production database?

Carefully. Every change has a staging test, an agreed window, measurement before and after, and a rollback script.

Can I do this without changing servers?

Almost always. Most of the gain comes from queries and indexes. Bigger hardware only comes in after those options are exhausted.

Tell us what you need to build.

Ask for a free assessment and get a clear path for your project, with no commitment.

Free assessment