I wonder, why new xml data type in Yukon internally stored as nvarchar(max).
I don't know for sure, but here http://www.itwriting.com/sqlyukon2.php
Garden sad, that they use SAX to navigate through xml document to make the
update.
<q>
We're using SAX-based technology to run through the entire document, and
find the place where you want to insert or change even one character in the
document.
</q>
Full-text search capability on xml data type column corroborate this.
It is not good for queries: the processor have to build data model each time
it runs the query. I think, it will be better to use PDOM or similar
persistent data model.
Another question is how the system build xml index on xml document, which
internally is text? Does it contain all text values for all nodes or only
attribute values? Does it index xml structure to quickly finds parent-child
relationships and descendant nodes?
With best regards, Alex Shirshov.
"Alex Shirshov" <nom...@mail.ru> wrote in message
news:eaYWbT7G...@tk2msftngp13.phx.gbl...
RWM> "Alex Shirshov" <nom...@mail.ru> wrote in message
RWM> This shows the shortcomongs of having someone who doesn't work on the
XML
RWM> Team explain how XML works. A few minor corrections:
RWM> XML is stored in a binary format
What do you mean? XML is a text and where is no advantage to convert it to
the binary format. Maybe xml document tree after parsing saved in data pages
in binary format? In that case all links beteew nodes must be relative. But
this approach is very inefficient!
I look at data in the pages via dbcc page and find that xml stores in linear
(childs after parent, following after childs) format! It also not so good,
'cause there are many numeric schemas to track xml structure, what has
better performance.
RWM> XML is indexed down to the element and attribute level
It seems so, 'cause it eats very much space. In my test with 3.6Kb xml
document, the index occupy 6 pages! Maybe you explain how it works and what
is
pk1, id, nid, tid, value, lvalue, lvaluebin, hid, xsinil, xsitype?
RWM> With an index you can search for values, paths, etc. without
RWM> parsing the
RWM> XML.
Parsing for what? It is already in binary format! :)
RWM> If there's an index we can go directly to the element you want to
RWM> update.
What do you mean I can? This optional?
RWM> Full text search does support XML.
No doubt! I just want to know how it works. :)
[Sorry, skipped]
This format is then transformed into a node table format when you perform
queries over them. The node table can be persisted as the primary XML index
on the column, so it is already there. That nodetable provides for very
efficient processing of path expressions for example. The columns you refer
to below are the column of that node table.
Fulltext works by using the normal fulltext index DDL. That identifies that
the column is of type XML and uses the built-in XML IFilter that will index
the element content (not attribute values).
Best regards
Michael
"Alex Shirshov" <nom...@mail.ru> wrote in message
news:uaHrV7SH...@TK2MSFTNGP12.phx.gbl...
Thank you very much, Michael! Now it is clear for me.
[Sorry, skipped]
Well, some more question.
Schemas. Why you don't support annotations and key and unique elements? It
isn't hard to implement from my point of view. Also, can you tell me how to
drop existing schema? I can't do what even there is no xml column in any
table within database which refer to it.
Query. What is namespace bounded to sql prefix for sql:variable or
sql:column functions? I definitely can say, that the name of this functions
is qualified, 'cause I cann't use any namespace with sql prefix in query,
which uses sql:variable for instance.
Regarding key/keyref and unique: key/keyref requires an XPath 1.0 engine for
the validator, which we decided not to implement in this release given our
benefit/cost analysis. If there are enough customer requests to have them
added, they will in an upcoming release.
The namepsace bound to sql will be documented (don't have it handy right
now).
Best regards
Michael
"Alex Shirshov" <nom...@mail.ru> wrote in message
news:uCDHh63I...@TK2MSFTNGP11.phx.gbl...
[Sorry, skipped]
Why is empty sequence treat as scalar value? For example, in this case there
is error
declare @xml xml
set @xml='<a/>'
set @xml::modify('delete if true() then () else /*')
Instead of this a have to write something like
set @xml::modify('delete if true() then ../ else /*')
Of course, in the real application in place of true() function will be real
condition.
Does XQuery engine support any type of comment? It seems to me, it doesn't
support standard syntax, which is (: :).
And you not answered about dropping schema
[q]
How can I drop existing schema? I can't do what even there is no xml column
in any
table within database which refer to it.
[/q]
drop xmlschema just doesn't work, although the output is the command
completed successfully!
declare @xml xml
set @xml='<a/>'
set @xml::modify('delete if (true()) then () else /*')
You will see that it works...
Re comment syntax. The syntax is still based on an older syntax proposal.
You need to write {-- --} for now.
You should be able to drop a schema and it seems to work on my current
build. Do you get an error message or is it just not doing it? Is the schema
referred to by another schema?
Thanks
Michael
"Alex Shirshov" <nom...@mail.ru> wrote in message
news:OullNL8I...@TK2MSFTNGP11.phx.gbl...
MRM> Your query below errors because of a syntax error. Once you write
MRM> declare @xml xml
MRM> set @xml='<a/>'
MRM> set @xml::modify('delete if (true()) then () else /*')
MRM> You will see that it works...
Hm...
I get "XQuery: Expression after 'delete' cannot return a scalar value." like
in the original example.
I have Microsoft SQL Server Yukon - 9.00.608 (Intel X86).
MRM> Re comment syntax. The syntax is still based on an older syntax
MRM> proposal. You need to write {-- --} for now.
Ok.
MRM> You should be able to drop a schema and it seems to work on my current
MRM> build. Do you get an error message or is it just not doing it?
No. All clear.
MRM> Is the schema referred to by another schema?
No.
Thanks
Michael
"Alex Shirshov" <nom...@mail.ru> wrote in message
news:eKQCq$hJEHA...@TK2MSFTNGP09.phx.gbl...