Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SQL Server 2005 - Rowsize effect on query performance?

Im trying to squeeze some extra performance from searching through a table with many rows. My current reasoning is that if I can throw away some of the seldom used member from the searched table thereby reducing rowsize the amount of pagesplits and hence IO should drop giving a benefit when data start to spill from memory.

Any good resource detailing such effects? Any experiences?

Thanks.

like image 813
Torbjörn Gyllebring Avatar asked Jan 24 '23 01:01

Torbjörn Gyllebring


1 Answers

Tuning the size of a row is only a major issue if the RDBMS is performing a full table scan of the row, if your query can select the rows using only indexes then the row size is less important (unless you are returning a very large number of rows where the IO of returning the actual result is significant).

If you are doing a full table scan or partial scans of large numbers of rows because you have predicates that are not using indexes then rowsize can be a major factor. One example I remember, On a table of the order of 100,000,000 rows splitting the largish 'data' columns into a different table from the columns used for querying resulted in an order of magnitude performance improvement on some queries.

I would only expect this to be a major factor in a relatively small number of situations.

like image 129
mmaibaum Avatar answered Jan 29 '23 10:01

mmaibaum