Wednesday, March 21, 2012

Does optimizer know about GUIDs?

Just wondering if there's anything the optimizer treats differently
when it sees a GUID instead of, say, an identity int, as PK. GUIDs
being random and identities being sequential, one could impute some
differences in efficiency, especially when one or both are clustered.
Thanks.
Joshua SternNo.
And, who says that GUIDs aren't sequential?
http://www.informit.com/articles/article.asp?p=25862&seqNum=7&rl=1
http://www.sqldev.net/xp/xpguid.htm
Adam Machanic
SQL Server MVP
http://www.datamanipulation.net
--
"jxstern" <jxstern@.nowhere.xyz> wrote in message
news:p82qf11f3bp12b9lkgt28q8f1gpinj6p8b@.4ax.com...
> Just wondering if there's anything the optimizer treats differently
> when it sees a GUID instead of, say, an identity int, as PK. GUIDs
> being random and identities being sequential, one could impute some
> differences in efficiency, especially when one or both are clustered.
> Thanks.
> Joshua Stern
>|||On Fri, 12 Aug 2005 18:29:52 -0400, "Adam Machanic"
<amachanic@.hotmail._removetoemail_.com> wrote:
>No.
>And, who says that GUIDs aren't sequential?
>http://www.informit.com/articles/article.asp?p=25862&seqNum=7&rl=1
>http://www.sqldev.net/xp/xpguid.htm
Hmm.
J.|||No, I do not think the optimizer tries to *guess* or infer anything about
guids... You provide the PK, FK , Indexes etc for the optimizer to use..
Just because a column is a uniqueidentifier does not mean it has to be
unique.
"jxstern" <jxstern@.nowhere.xyz> wrote in message
news:p82qf11f3bp12b9lkgt28q8f1gpinj6p8b@.4ax.com...
> Just wondering if there's anything the optimizer treats differently
> when it sees a GUID instead of, say, an identity int, as PK. GUIDs
> being random and identities being sequential, one could impute some
> differences in efficiency, especially when one or both are clustered.
> Thanks.
> Joshua Stern
>

No comments:

Post a Comment