Thursday, March 8, 2012

columns in indexes

How are these columns stored? If I am learning correctly, the added non-key columns in the index are not part of the index limit? If I have a large amount of data that I cannot fit onto an index page, what's being done. Just a pointer to the data that's isolated on it's own page? I guess this would be less overheard than performing an index scan with a pointer to the non-key column (I don't know, I'm asking) and no pointer would be better insert performane.

I looked in the BOL and couldn't find how this stuff is stored. Can you help - does my question even make sense?

Just wanted to add what I found.

According to MS documents are a form of Oracle's Index Organized Tables. Does this mean then that the entire table is an index?

Can you help me understand IOTs?

From http://www.microsoft.com/technet/prodtechnol/sql/2000/deploy/sqlorcle.mspx:

Table and Index Storage Parameters

With Microsoft SQL Server, using RAID usually simplifies the placement of database objects. A SQL Server clustered index is integrated into the structure of the table, like an Oracle index-organized table.

|||Does this mean then that the entire table is an index?

Yes. When you create a clustered index on a table, all the data in the table is placed in the data pages of the index (at the leaf level). You can read more about this in SQL Server 2005 Books Online in the topic Clustered Index Structures.

You can also create nonclustered indexes. These indexes contain the index key values and row locators that point to the storage location of the table data. See the topic Nonclustered Index Structures in Books Online.

Regards,|||I believe you are referring to composite index key. Here is from BOL

"Up to 16 columns can be combined into a single composite index key. All the columns in a composite index key must be in the same table or view. The maximum allowable size of the combined index values is 900 bytes. For more information about variable type columns in composite indexes, see the Remarks section.

Columns that are of the large object (LOB) data types ntext, text, varchar(max), nvarchar(max), varbinary(max), xml, or image cannot be specified as key columns for an index"

So your data will fit into index page.

thanks

No comments:

Post a Comment