Improving performance by limiting the number of columns and rows
It has been observed that many developers tend to use SELECT *
in queries even if only a few columns of the tables are needed. It's also observed that, many a time, people execute the SELECT
query without applying a proper filter clause, which returns more rows in the result set than actually required. After returning result sets to the application, filtering rows in the result sets in application logic as and when needed which is not really a good practice. Both of these cases create big result sets with unnecessary columns and rows, which has many drawbacks. The following are the few of them:
- A big result set creates I/O overhead by reading more columns/rows from the pages that ...
Get Microsoft SQL Server 2012 Performance Tuning Cookbook now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.