Forum Discussion
Difference SQL Server 2022 vs 2017 Bind table
- Feb 25, 2025
In SQL Server, bound tables (also known as memory-optimized tables) behave differently compared to traditional disk-based tables in terms of indexing and statistics.
Key Differences Between SQL Server 2017 and 2022 for Bound Tables:
Statistics and Indexes in Memory-Optimized TablesIn SQL Server 2017, memory-optimized tables do not automatically maintain statistics. This means that query optimization relies only on indexes, and there’s no automatic adjustment based on changing data distributions.
In SQL Server 2022, query optimization for memory-optimized tables has improved. The optimizer now better utilizes existing statistics from indexes, even though statistics are still not automatically maintained as they are in disk-based tables.
Automatic Updates to StatisticsSQL Server 2017 does not auto-update statistics for memory-optimized tables. You must manually update them using UPDATE STATISTICS to ensure queries perform efficiently.
SQL Server 2022 introduces better query processing enhancements, which may allow the optimizer to make better use of pre-existing statistics, resulting in improved index utilization.
Intelligent Query Processing (IQP) ImprovementsSQL Server 2022 includes multiple enhancements in Intelligent Query Processing (IQP), which allow better estimation of row counts and improved index selection.
This can explain why you're seeing index usage referring to statistical information in SQL Server 2022, whereas in 2017, the optimizer largely ignored statistics for bound tables.
What This Means for You:
If you are using SQL Server 2022, the optimizer may reference statistics when working with indexes, leading to potential performance improvements.
If you are using SQL Server 2017, you must manually update statistics on memory-optimized tables to avoid performance degradation.
You should test query execution plans in both versions to compare behavior and ensure indexes are used efficiently.
What for a "bind table" do you mean?