Forum Discussion
What are the best practices for managing and optimizing a SQL table that contains 10 million records
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 https://learn.microsoft.com/en-us/sql/relational-databases/performance-monitor/monitor-resource-usage-system-monitor?view=sql-server-ver16 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.