日期:2014-05-16 浏览次数:20499 次
SET STATISTICS IO ON ;
SET STATISTICS TIME ON ;
SELECT DCPPaymentName FROM DCPPaymentTracking WHERE DCPPaymentName='DP0116'
SET STATISTICS TIME OFF;
SET STATISTICS IO OFF;
/*
SQL Server parse and compile time:
CPU time = 0 ms, elapsed time = 0 ms.
(108318 row(s) affected)
Table 'DCPPaymentTracking'. Scan count 5, logical reads 388503, physical reads 3828, read-ahead reads 240576, lob logical reads 0, lob physical reads 0, lob read-ahead reads 0.
SQL Server Execution Times:
CPU time = 3634 ms, elapsed time = 156454 ms.
*/
所以可以说,列存储索引是有效的,你的例子比较复杂,我也没环境,不好测,我初步觉得是因为你没有用好列存储索引,如果你要找的数据就在列存储上面,那么应该是很快的。
SET STATISTICS IO ON ;
SET STATISTICS TIME ON ;
SELECT DCPPaymentName FROM DCPPaymentTracking WHERE DCPPaymentName='DP0116'
SET STATISTICS TIME OFF;
SET STATISTICS IO OFF;
/*
SQL Server parse and compile time:
CPU time = 0 ms, elapsed time = 0 ms.
(108318 row(s) affected)
Table 'DCPPaymentTracking'. Scan count 4, logical reads 472, physical reads 0, read-ahead reads 0, lob logical reads 0, lob physical reads 0, lob read-ahead reads 0.
SQL Server Execution Times:
CPU time = 94 ms, elapsed time = 1246 ms.
*/