SAMPLE n ;
4) SELECT TOP n * FROM
Hi
3rd and 4th Query is quicker than the 3rd one any how the explain plan loos same for both the query except the sorting step for the 4th query
as all-AMPs SAMPLING step will take longer time than all-AMPs STAT FUNCTION
2nd Query is the fastest among the four.
While comparing 1st and 2nd Query 1st one will do all-AMPs RETRIEVE and the estimate will be no. of rows in the table where as 2nd Query will
do an all-AMPs SUM with an estimate will be one.
ideally there is no comparison between 1st and 2nd Query
Hope this helps I'm too looking for a better answer with internal mechanism
Thanks
Machha
|
| |
|
|
|
|
| |
| |
|
|
Copyright 2016 - All Rights Reserved |
Last Modified: 15 Jun 2023 |
|