Index Strategy on GUID Column

  • Hi,

    Most of my tables are using a surrogate key which is a GUID column and it's set as a primary key. No index used so far and there's heavy load on the tables.

    Im planning to use index to speed up query. I come up with the decision whether or not I put index in the GUID column. I try to use clustered index on the GUID column as most tables joined thru this column. There're also other candidates for column indexing.

    My question:

    1. Is it Ok to put an index on a GUID col as its size maybe big? which type suitable for the index, clustered or non clustered?

    2. Let's say I put a clustered index on the GUID col. and I want to put another nonclustered index on some other col. Would this cause much overhead?

    Any thought would be appreciated much.

    Thanks in advance

    Hendry

  • Nothing wrong with that. Yes, its more overhead than an int, but that is just part of using a guid. Whether you should cluster it depends on whether you have another column that would be better suited, usually one that you do a range type query on.

    Andy

    http://www.sqlservercentral.com/columnists/awarren/

  • This one might also be of interest http://www.sqlservercentral.com/forum/link.asp?TOPIC_ID=14025

    Frank

    http://www.insidesql.de

    http://www.familienzirkus.de

    --
    Frank Kalis
    Microsoft SQL Server MVP
    Webmaster: http://www.insidesql.org/blogs
    My blog: http://www.insidesql.org/blogs/frankkalis/[/url]

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply