SQL Server: efficient DISTINCT on dates | EXPLAIN EXTENDED

SQL Server: efficient DISTINCT on dates | EXPLAIN EXTENDED

瀏覽:1044
日期:2025-04-25
This table has 2,000,000 records with 1,389 distinct dates. There is an index on a DATETIME column as well as an index on a computed persisted DATE column. Let's use plain DISTINCT clause on DATETIME column casted to a DATE: SELECT COUNT(date ......看更多