Showing posts with label theres. Show all posts
Showing posts with label theres. Show all posts

Sunday, March 25, 2012

Does SQL 2005 take XML query time into acount?

if there's an [untyped] XField.Query() in a select, does SQL 2005 do
anything (internally) like an automatic sub-select if there's standard
fields to compare, saving the XML analysis for later, (to avoid uneccessary
calculations)?
Hello Jerry,
XML queries do cache their query plans, of course, like any other T-SQL query.
However, unindexed XML has to reconstruct the node table each time. That's
an expensive unit of work (usually), so the best thing you can (usually)
do is create an primary XML index over those instances. That "kind of" does
that you're looking for here.
Cheers,
Kent
|||> XML queries do cache their query plans, of course, like any other T-SQL
> query. However, unindexed XML has to reconstruct the node table each time.
> That's an expensive unit of work (usually), so the best thing you can
> (usually) do is create an primary XML index over those instances. That
> "kind of" does that you're looking for here.
Thanks for all, Kent ;)
sql

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 Stern
No.
And, who says that GUIDs aren't sequential?
http://www.informit.com/articles/art...&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/art...&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
>