sql - Does the size of the data stored in the record affect the Clustered index performance? -
i have 3 tables.
- primary fact table (facttable)
- a table containing int field + other 'n' varchar(50) fields(table001)
- a table containing int field + other 'n' varchar(max) fields(table002)
records in each table: #5 million rows
query:
select * facttable f (nolock) inner join table001 t001 (nolock) on f.id = t001.id inner join table002 t002 (nolock) on t002.id = f.id f.datefield = '2014-02-01'
all tables have clustered index on field 'id'(which used in joining tables i.e., foreign key)
the clustered indices not fragmented(fragmentation percentage < 5%) on tables
the case when join 3 tables, seeing in execution plan cost of joining table002 higher table001. there reason behavior?
link xml execution plan: https://onedrive.live.com/redir?resid=7e436ae9d73999b0%21120
i couldn't paste xml content because of size restriction.
another link : http://www.expinos.in/executionplan.sqlplan
the size of columns in row, not in index, not effect performance of containing index itself.
however,
large non-indexed columns effect performance of table based operations. you'll less rows on page, when scanning, you'll have read more pages.
large non-indexed columns included in query have obvious direct effect on query performance. you'll have read bigger values disk/memory, although optimiser try late.
the size of columns in index effects performance of index.
the size of columns in clustered index effect performance of indecies on table
is easier compare 1 byte or 10000? easier hash 1 byte or 10000? easier read 1 byte disk/memory or 10000?
Comments
Post a Comment