Perform "Sample Contents" on a table causing insert record into dbc.QryLog with SQLText "Select * from database.table". My question Is : Is somewhere information about number of rows transfered to user ?
In column NumResultRows I see total number of records in a table but in fact Assistant shows to me only 500 records(configured). So, how can I proove to my Admin that I receive only 500 records and do not full table scan and receive all records from a table.
As you point out, the query that is run is "Select * from database.table". We stop retrieving the rows from the result set after we reach the configured limit. So the full table's results have been spooled but not all the results are processed.
Currently, the framework we use doesn't provide us with the opportunity to add something like a SAMPLE clause to the select statement to limit the number of rows that are made available. Would that be something that would help in your circumstance?
The most important thing for me is: Does this operation causes the same system load as the ordinary "Select * from database.table"? As You wrote all results are spooled so when the table has billion records my little "Sample Contents" can cause serious system load and block another processes.
As I understood the only difference between 'Sample contents' and "Select * from database.table" is in I/O operations between database and client ? Am I right?
May be it would be the best idea to use "select top LIMIT * from database.table" instead of 'Sample contents' ? I've also read that TOP clause is more efficient that SAMPLE clause.