问题
My app is querying - among the rest - a table that has a blob column and other metadata columns (no other LOB columns).
I've read that if the object itself is not too big, it may still be stored inside the table and not as a link to itself. In this case, a 'SELECT' statement on such a table, even if it does not contain the blob, like:
SELECT Date FROM MyTable
might still retrieve the blob (in the server only), thus taking longer to perform.
Is this true? Can anyone provide an explanation or a link to one?
My background in SQL is rather basic, so I might not be accurate, sorry.
Thanks.
回答1:
If you create a non-clustered index on the date column, then you can retrieve the data by scanning the index, instead of scanning the entire table. You should see I/O go way down.
来源:https://stackoverflow.com/questions/11671226/sql-server-select-on-a-table-that-contains-a-blob