Locks everywhere

In this post I'm going to talk about locks on SQL Server. Locks are necessary, they are used in all operations in the database. Don't get confused about blocking, locking and blocking are totally different. When we talk about lock, doing something in the database, like an update and select though will cause a type … Continue reading Locks everywhere

Simple way to understand transaction isolation levels

I was talking with a friend about how a database works and she asked me to explain transaction isolation levels to her. So let's try... My first intent was to create an analogy with something simple, for example, a book. Two people trying to read/write on the same book. They can read at the same … Continue reading Simple way to understand transaction isolation levels

Memory-optimized Logging

In a previous post I talked about transaction log works, and what about using a memory-optimized table? SQL Server has the feature Memory-Optimized Objects to improve performance. In-memory nonclustered indexes are implemented using a data structure called a Bw-Tree. A Bw-Tree is a lock and latch-free variation of a B-Tree. In-memory architecture: To enable an … Continue reading Memory-optimized Logging

What the Checkpoint does?

Checkpoints flush dirty data pages from the buffer cache of the current database to disk. This minimizes the active portion of the log that must be processed during a full recovery of a database. During a full recovery, the following types of actions are performed: The log records of modifications not flushed to disk before … Continue reading What the Checkpoint does?

VLF (Virtual Log Files)

To see how many VLFs you have solely look at the number of rows returned by DBCC LOGINFO. The size and number of VLFs you'll have depends largely on the size that the chunk is when it's added to you transaction log. There is no general rule how to determine the best values for the … Continue reading VLF (Virtual Log Files)

There is insufficient system memory in resource pool

Doing crash and recovery tests on my local machine I got the SQL Server instance not going online. After trying the third time to bring my instance online thinking was something else problem I saw the SQL Server errolog file and I could see the problem. Not enough memory, but wasn't on my machine, was … Continue reading There is insufficient system memory in resource pool

Query Store Usage Scenarios

What is Query Store? Query Store is a tool to troubleshoot query performance by capturing a range of information about query usage, CPU, memory consumption, I/O and execution time, and retaining every Execution Plan for analysis. So, if query store stores my query information, what kind of scenarios I could use this information? To fix … Continue reading Query Store Usage Scenarios