I have done a test on a query set to see the performance. in which i had found the query without clustered index is fast,WHY...?
The query is below
select A.col1 ,B.col2,B.col3 from table1 A inner join table2 on A.col1 =B.col1
The performance is
Hash Match( both have No Index or either have no index)
(913271 row(s) affected) Table 'Table B'. Scan count 5, logical reads 18681, physical reads 193, read-ahead reads 18681, lob
logical reads 0, lob physical reads 0, lob read-ahead reads 0. Table 'Table B'. Scan count 5, logical reads 57798, physical reads 4, read-ahead reads 57798, lob logical reads 0, lob
physical reads 0, lob read-ahead reads 0. Table 'Worktable'. Scan count 0, logical reads 0, physical reads 0, read-ahead reads 0, lob logical reads 0, lob physical
reads 0, lob read-ahead reads 0.
(1 row(s) affected)
SQL Server Execution Times: CPU time = 3665 ms, elapsed time = 9391 ms.
Total Time :09 Sec
Merge Join:(Both have unique non clustered index)
(913271 row(s) affected) Table 'Table B'. Scan count 1, logical reads 18723, physical reads 6, read-ahead reads 18727, lob
logical reads 0, lob physical reads 0, lob read-ahead reads 0. Table 'Table B'. Scan count 1, logical reads 56811, physical reads 21, read-ahead reads 56921, lob logical reads 0, lob
physical reads 0, lob read-ahead reads 0.
(1 row(s) affected)
SQL Server Execution Times: CPU time = 1466 ms, elapsed time = 14881 ms. SQL Server parse and compile time:
Total Time :14 Sec