You are here: Re: Clustered index and varchar « MsSQL Server « IT news, forums, messages
Re: Clustered index and varchar

Posted by Erland Sommarskog on 08/06/05 14:58

(jim_geissman@countrywide.com) writes:
> One table I manage has a clustered index, and it includes some
> varchar columns. When it is initially created, all the columns
> in the clustered index are populated, and then some of the longer
> varchars are populated through update queries. If the varchar
> columns are stored outside the clustered structure, then it would
> make sense to create the clustered index before populating the
> varchar columns. Otherwise it would make sense to wait, because
> populating the varchars might cause page splits. Are varchar
> columns stored on the page along with the fixed-size columns, or
> are they managed separately with the page containing pointers
> to them?

As Hugo said, the varchar data is stored within the page.

One should be careful with having to large clustered-index keys. In
non-clustered indexes, the value of clustered-index key is used as
row locator. Thus a wide clustered key, also affects the size of
the non-clustered index.

Of course, if you don't have any non-clustered indexes on the table,
this is not much of an issue.


--
--
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinfo/productdoc/2000/books.asp

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация