Latest Posts

Installing MongoDB on Debian

In preparation for an upcoming project (stay tuned for more details), I needed to set up a MongoDB database server. In this post, we’ll walk through how to install and configure MongoDB on Debian 12. At the time of writing, Debian 13 is the most up to date stable version of Debian, though MongoDB is…

Keep reading

Reseed Identity – Can it Cause Clashes?

I recently had cause to reseed an identity column on a table in SQL Server, which got me wondering “If we reseed an identity column to a value lower than the existing identity values in the column, could it cause a clash?” Because why wouldn’t you wonder if you can cause something to break, whilst…

Keep reading

sp_executesql and Execution Plans

Whilst I would say the actual execution plan is the most useful, estimated execution plans have their place – sometimes you just need to see estimates or a quick verification that a change you have made has had some effect on plan shape. I find them helpful to quickly see if a change made to…

Keep reading

Setting up the Stack Overflow database in Postgres

I’ve worked with Microsoft SQL Server for many years as well as dipping my toes into the MySQL world as and when required, however, I have not done as much with PostgreSQL. It’s hard to ignore the momentum that Postgres has built in recent years; it is moving up the Stack Overflow Developer Survey and…

Keep reading

Curse of the Catch-All query

The catch-all query – a fairly common pattern that is often seen in SQL Server apps where there is a list of results that can be filtered by one or more criteria. This usually takes the form of a stored procedure that is constructed as below. The example stored procedure is created in the Stack…

Keep reading

OR predicates and Indexes

In this post, we will look at how SQL Server accesses indexes when an OR predicate is used. For this demo, I am going to use the Stack Overflow Database. I am using the large 2024 version provided under cc-by-sa 4.0 licence from Stack Exchange Data Dump and running in compatibility level 160 on a…

Keep reading

Four Flavours of Postgres Install – Part 4 (Windows)

This post is the next in a short series exploring the different ways we can install a PostgreSQL server. This time, we’ll look at a vanilla install on Windows – no Docker involved. The VM I’ll use the same spec VM as in the last post, which is sufficient for demonstration purposes: Firstly, let’s hop…

Keep reading

In a Query Plan Near You – Stats Loaded For Compilation

Something I have been making use of recently is the change in the way statistics that have been used to compile a plan are presented to us as SQL Server users. On a number of occasions I have needed to understand, or at least get some sense of, which statistics SQL Server has used to…

Keep reading