Forum Discussion
Vallikannu
Dec 05, 2024Copper Contributor
What are the best practices for managing and optimizing a SQL table that contains 10 million records
I have a table that currently holds 10 million records, and it continues to grow daily. As the dataset expands, I'm encountering significant challenges in retrieving data efficiently and generating r...
rodgerkong
Dec 09, 2024Iron Contributor
You need to locate the real bottleneck first. You'd better maintain a test enviroment, in which you can make tune and record performent metrics to compare with baseline, it will help you to make choice.
You can use Monitor Resource Usage (Performance Monitor) - SQL Server | Microsoft Learn to make a basic judgment on whether the bottleneck is in CPU or IO or memory. After this, make adjustments, check the performence if it goes better.
CPU overload, more CPU cores is a easy solution, but optimize indexes and query might be cheaper and get huge gain sometimes. This requires analyzing the query plan to find the direction of optimization.
IO overload can be resolved by using SSD, more RAID disks, better storage infrastructure.
The most easy way to resolve memory not enought is more money -- adding memory.
Optimizing queries and indexes may help reduce the pressure on IO and memory, but it usually need more skill.