Press "Enter" to skip to content

Curated SQL Posts

What VACUUM Really Does in Postgres

Radim Marek explains:

There is common misconception that troubles most developers using PostgreSQL: tune VACUUM or run VACUUM, and your database will stay healthy. Dead tuples will get cleaned up. Transaction IDs recycled. Space reclaimed. Your database will live happily ever after.

But there are couple of dirty “secrets” people are not aware of. First of them being VACUUM is lying to you about your indexes.

Click through to learn more.

Comments closed

Choosing a Vector Database

Joe Sack has some advice:

Vector search has become a standard approach for semantic search and RAG. Whether you’re evaluating a dedicated vector database, SQL Server 2025, a Postgres extension like pgvector, or an in-memory library, there are certain production realities worth planning for.

Admittedly, my vector database decision boiled down to “What can I actually get to work in my non-internet-connected on-premises environment where everything is locked down to the point that bringing in new software is a major hassle?” That quickly narrowed down the set of viable options.

Comments closed

Microsoft Fabric Lakehouse Schemas now GA

Ted Vilutis makes an announcement:

Schema lakehouses are now Generally Available. By using schemas in lakehouses, users can arrange their tables more efficiently and make it easier to find data. When creating new lakehouses, schema-enabled lakehouses will now be the default choice. However, users still have the option to create lakehouses without a schema if they prefer.

Read on to see how they work, as well as a bug(?) around pinned lakehouses.

Comments closed

Constraints in PostgreSQL

Gulcin Yildirim Jelinek digs into how PostgreSQL handles database constraints:

Constraints give you fine-grained control over data integrity and if any inserted or default value violates them, PostgreSQL raises an error.

In short, constraints are rules enforced by the database to keep your data valid and consistent. When constraints are not enforced, data issues start to leak in and eventually turn into bugs. Spending time understanding constraints helps prevent subtle data bugs later on.

Read on for information around constraint types in Postgres (including exclusion constraints), as well as triggers and domains. Exclusion constraints are new to me, but apparently allow for things like preventing timeframe overlaps, so that’s pretty useful.

Comments closed

Performance Tuning SQL Server in KubeVirt

Andrew Pruski speeds things up:

Following on from my last post about Getting Started With KubeVirt & SQL Server, in this post I want to see if I can improve the performance from the initial test I ran.

Andrew digs into the settings and gets to about 98% of StatefulSet performance, which is considerably better than the starting point. But it does take a good bit of configuration and effort to get there.

Comments closed

Backup and Recovery versus Disaster Recovery

Brendan McCaffrey draws a distinction:

It surprises me how many people treat “disaster recovery” and “backup & recovery” as interchangeable terms. But backups are not disaster recovery, and disaster recovery is not a backup strategy. Confusing the two creates a false sense of security that often becomes visible the moment something goes wrong. The goal of this post is to offer clarity on what separates these concepts, so you can design a strategy that actually protects your business, not just your data.

Read on for Brendan’s argument.

Comments closed

Extension Management in Postgres

Kellyn Gorman doesn’t just install a bunch of stuff:

PostgreSQL’s true power doesn’t just come from its rock-solid relational engine, but it’s the fact that Postgres can grow with you. Extensions allow you to bolt on new capabilities, enhance performance, integrate external tools, and transform the database into something far more powerful than its default installation, which is something I’m really learning to love.

From pg_stat_statements to pgvector, logical decoding plugins, job schedulers, and custom procedural languages, Postgres extensions behave like feature packs you can enable at the database level. That also means DBAs must know how to inspect, maintain, and manage them just as carefully as any schema or server configuration.

Read on for several tips for proper extension care and feeding.

Comments closed

REST API Invocation in SQL Server 2025

Tomaz Kastrun continues an advent of SQL Server 2025. First up is external REST API endpoint execution:

This new functionality, you can call to the system stored procedure sp_invoke_external_rest_endpoint, and call / get:

– Call REST/GraphQL endpoints from other Azure services
– Have data processed via an Azure Function
– Update a Power BI dashboard
– Call an on-premises REST endpoint
– Talk to Azure OpenAI services

Then, Tomaz uses this to call a language model:

After short introduction into the  sp_invoke_external_rest_endpoint we will look into creating a REST endpoint for using LLM.

Comments closed

RegEx Performance in SQL Server 2025

Brent Ozar has an update:

Back in March 2025 when Microsoft first announced that REGEX support was coming to SQL Server 2025 and Azure SQL DB, I gave it a quick test, and the performance was horrific. It was bad in 3 different ways:

  1. The CPU usage was terrible, burning 60 seconds of CPU time to check a few million rows
  2. It refused to use an index
  3. The cardinality estimation was terrible, hard-coded to 30% of the table

Read on to see what has changed. It’s obviously not perfect, but just as obviously is much better than what Brent saw in Azure SQL DB at the time.

Comments closed