Posts

My SQL Server Blog Post Recap of March

Image
SQL Server Post Recap Organized by Topic 🧠 1. Foundations SARGability: the One Concept You Absolutely Must Understand! → Learn how SQL Server uses indexes and why SARGability is critical for query performance. Why SELECT * Is Still Killing SQL Server Performance in 2026? → Discover how unnecessary columns increase IO, CPU usage, and network load. The Most Dangerous SQL Server Query Pattern Nobody Talks About → A hidden anti-pattern that silently destroys performance in production systems. Why Your SQL Server Query Is Fast in SSMS but Slow in Production → Understand parameter sniffing and environment-related performance issues. ⚡ 2. Execution Plans Read an EXECUTION PLAN in 10 MINUTES!!! → A beginner-friendly guide to understanding SQL Server execution plans quickly. Execution Plan Operators that Secretly Kill Performance! → Learn to identify hidden performance killers inside execution plans. Avoid That Damn Table Spool! → Real-world tuning example sho...

SQL SERVER. Is Your Database Over-Indexed? Your Indexes Might Be Killing Performance 🔥

Image
Is Your Database Over-Indexed? Your Indexes Might Be Killing Performance 🔥 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. So you add an index. It gets faster… for a moment. Then everything else gets slower. 👉 What just happened? You might be over-indexing your database. 🧠 The Myth: “More Indexes = Better Performance” Indexes are powerful. But they are NOT free. They speed up SELECT queries ✅ They slow down INSERT / UPDATE / DELETE ❌ They consume memory and storage They increase CPU usage 💣 Indexes don’t just speed up queries… they slow down everything else. 🔥 Real Case – Over-Indexing Explosion CREATE INDEX IX_Orders_Date ON Orders(OrderDate); CREATE INDEX IX_Orders_Customer ON Orders(CustomerId); CREATE INDEX IX_Orders_Status ON Orders(Status); CREATE INDEX IX_Orders_Date_Status ON Orders(OrderD...

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 ...