APPROX_COUNT_DISTINCT counts distinct values with almost no memory. Tested on 5 million rows, it was within 2.2 percent of the exact count and needed no memory grant, while COUNT(DISTINCT) asked for 436 MB. It was not faster.
SQL Server on Virtual Machines: Settings That Matter
SQL Server on virtual machines needs deliberate CPU, memory, NUMA, and storage settings; learn what to inspect before blaming a slow query.
Windows Settings That Affect SQL Server
Windows settings can influence SQL Server CPU speed, file growth, memory stability, and security scanning; learn what to inspect and validate.
Reading Memory Clerks to See Where Memory Goes
Memory clerks show how SQL Server allocates memory among engine components; learn to read the DMV, spot unusual growth, and investigate safely.
Memory Grants: Why a Query Waits for Memory
Memory grants can leave SQL Server queries waiting on RESOURCE_SEMAPHORE; inspect estimates, grants, and spills before adding memory.
Estimating How Much Memory SQL Server Needs
How much memory SQL Server needs depends on the active working set, grants, and host headroom; learn to measure pressure and avoid fixed ratios.
SQL SERVER – What DBCC Memory Cache Commands Actually Clear
SQL Server retains memory caches to support later work. I investigate memory pressure before trying to release them.







