Posts

SQL SERVER 2025, Why Your SQL Query Is Burning CPU (And You Don’t See It)

Image
Why Your SQL Query Is Burning CPU (And You Don’t See It) 🔥 Hi SQL Server Guys, 👉 If you missed my previous post, check it out here: SQL Server: Stop Defragmenting! The Auto Index Compaction Feature That Changes Everything Your query is slow. You check IO. Everything looks fine. So… what’s killing performance? 👉 CPU.  🧠 CPU vs IO (Simple but Critical) IO-bound → waiting on disk (reads, writes) CPU-bound → heavy computations Most people only look at IO. That’s a mistake. ❗ If IO is low and the query is still slow… CPU is your suspect. 🔥 Case #1 – Functions on Columns (The Silent Killer) SELECT * FROM Orders WHERE YEAR(OrderDate) = 2025; ❌ Problem: Function applied on column Index NOT used Full scan + CPU spike ✔️ Fix: WHERE OrderDate >= '2025-01-01' AND OrderDate < '2026-01-01' 💣 Functions on columns don’t just break indexes… they burn CPU. 🔥 Case #2 – Scalar UDF (The Invisible Killer) SELECT ...

I Tried Using SQL Server 2025 as an AI Vector Database… Here’s What Happened 😏

Image
I Tried Using SQL Server 2025 as an AI Vector Database… Here’s What Happened 😏 Hi SQL SERVER Guys, 👉 If you missed my previous post, check it out here: SQL Server: Stop Defragmenting! The Auto Index Compaction Feature That Changes Everything Today, We are diving into what everyone is dreaming about: AI inside the database .  While everyone is chasing the latest LLM hype, the real (and practical) question for us DBAs and Data Engineers is:  Can SQL Server 2025 actually handle native vector search ...or is it just marketing fluff? On this blog, we don't trust the hype. We trust benchmarks . 🧠 What is the new VECTOR data type? SQL Server 2025 introduces native support for vectors. Instead of "hacking" your way through with float tables, we now have : Optimized storage for embeddings Native functions like VECTOR_DISTANCE SIMD support for fast mathematical calculations at the CPU level In simple terms: we can now easily store vectors and compare...

SQL Server: Stop Defragmenting! The Auto Index Compaction Feature That Changes Everything

Image
🔥 Stop Defragmenting indexes: Auto Index Compaction feature preview in SQL Server – This Feature will Kills Index Maintenance Jobs! Hi SQL Server guys, In the previous post we analyzed performance improvements in SQL Server 2025 CU3 and uncovered hidden optimizations that nobody talks about. 👉 If you missed it, check it out here: SQL Server 2025 CU3 – The Hidden Performance Fix Nobody Talks About In this post instead we will introduce an amazing news in the SQL Server world, i call  Auto Index Compaction feature. 🚀 Introducing Automatic Index Compaction Automatic index compaction is a new built-in feature in the SQL Server engine that compacts indexes in the background with minimal overhead. No jobs. No maintenance plans. No late-night rebuild scripts. Just… the engine doing the job for you. ⚡ Executive Summary Indexes are compacted automatically in background Works continuously as data changes Reduces storage, I/O, CPU and memory usage No need for...

SQL Server 2025 CU3 Backup/Restore Performance: Benchmark and the Real Impact of Patch 4836855

Image
🔥 SQL Server 2025 CU3 vs CU2 – Testing Fix 4836855 (Backup/Restore I/O Alignment) Hi SQL SERVER Guys, In the previous post we started analyzing performance differences between SQL Server 2025 CU2 and CU3. We showed real benchmark results and performances increment nobody talks about. 👉 If you missed it, here is the previous article: SQL Server 2025 CU3 – The Hidden Performance Fix Nobody Talks About (False Sharing Benchmark) Today we continue our investigation and analyze the performance improvements introduced by the patch below: 🧪 Fix 4836855 – Backup/Restore I/O Alignment This fix aims to improve how SQL Server handles I/O operations during backup and restore . 👉 In simple terms: Reduces inefficient I/O alignment Improves throughput during backup/restore Reduces latch contention on I/O operations Removes hidden bottlenecks caused by internal serialization 💡 Important insight: The fix doesn’t make your disk faster — it removes artificial serializa...

SQL Server 2025 CU3 – The Hidden Performance Fix Nobody Talks About (False Sharing Benchmark)

Image
SQL Server 2025 CU3 – Does It REALLY Fix CPU Contention? Let’s Benchmark It 🔥 Hi SQL SERVER Guys, Today... we go serious . No theory. No assumptions. No marketing. 👉 Just tests, numbers and benchmarks . We are going to validate one of the most interesting fixes introduced in SQL Server 2025 CU3 : "Reduces CPU contention on high-core servers by fixing cache line conflicts (false sharing), improving overall scalability." (If you missed it, check my full CU3 breakdown here 👇) 👉 SQL Server 2025 CU3 – Critical Fixes You Should NOT Ignore 🎯 Benchmark Goal We want to verify if CU3 really reduces: CPU contention Spinlocks / latch contention Scalability issues on multi-core systems 👉 In short: parallel workload scalability ⚠️ The Real Problem: False Sharing The bug is related to: 👉 false sharing so when: multiple CPU cores writing on the same cache line continuous cache invalidations massive performance degradation ...

SQL Server 2025 CU3 – Critical Fixes You Should NOT Ignore (Regex & Vector Bugs Fixed) ⚠️

Image
SQL Server 2025 CU3 – Critical Fixes You Should NOT Ignore (Regex & Vector Bugs Fixed) Hi SQL SERVER Guys, If you are working with SQL Server , you already knows that performing the cumulative updates is very important since it is the way chosen by Microsoft both to fix bugs and to apply security patches . You really should not skip them! With Cumulative Update 3 (CU3) , released in March, 12 2026 Microsoft fixed several important issues — including two critical ones we already talked about in my recent posts: REGEX engine crash issues VECTOR data type breaking SqlLocalDB Why CU3 Matters CU3 is not just a minor patch. It contains engine-level fixes that impact: Performance scalability Regex engine stability Vector processing High Availability scenarios Linux deployments 👉 Full official Microsoft reference:  SQL Server 2025 CU3 – Improvements and Fixes Improvement and Fixes included in this update  This is a readable breakdow...

SQL Server 2025 Vector Data Type – Why It Matters for AI (and Known Bugs) ⚠️

Image
SQL Server 2025 Vector Data Type – Why It Matters for AI (and Known Bugs ⚠️) Hi SQL SERVER Guys, If you missed my previous deep dive on REGEX performance, you can read it here: 👉  SQL Server 2025, REGEXP_LIKE Can Trigger Batch Mode Today we move into something even more interesting: the new Vector Data Type in SQL Server 2025 that introduces native support for AI workloads. This is not just a new data type… it’s a major shift toward AI-native databases . What Is the Vector Data Type? The VECTOR data type is designed to store embeddings . Embeddings are numerical representations of: text images documents code Example: DECLARE @v VECTOR(3) = [0.1, 0.5, 0.9]; Each value represents a dimension in a vector space. When Was It Introduced? The VECTOR data type was introduced in SQL Server 2025 as part of Microsoft's push into: AI integration semantic search RAG (Retrieval-Augmented Generation) This aligns SQL Server with modern ...