Ivan,
I made following things and now the speed is very good (5922 ms for 1000 items):
1) Made the restructuring attr -> element as you recommended.
2) Create the index of xs:integer type (on the most constrained field).
3) Use
$ms := index-scan("index", 12345, "EQ")
for `a' field and then restrict the sequence like $m := $ms [(
b/text() eq $b ) and ( c/text() eq $c )].
Thanks!
2009/2/18 Ivan Shcheklein <[email protected]>:
> Andrey,
>
>> Hm. The document was imported from another source.
>> @name attribute has values like 'A#B' or '1-7'...
>> But, of course, I can try to rename them.
>
> Actually, I mean to transform some (e.g. a, b, c names) element/attribute
> pairs either into single element or single attribute:
>
> <c name="a">some value</c> -----> <a>some value</a>
>
> Such transformation will give us an ability to create indexes we need:
>
> create index "index" on fn:collection("samples")/root/item by ./a as
> xs:string
>
> Then you will be able to retrieve items with exact value of "a":
>
> index-scan("index", "12345", "EQ")
>
> returns "item" (s) from the "samples" collection which has (have) exactly
> <a>12345</a> inside.
>
>
>> "myChild" has 7211 <item>`s.
>>
>> "samples" is a sample for document with 162382 <item>`s.
>
> Ok. I got it. Will this proportion be the same in the future? Or current
> collections are just examples to try on and are subject to change.
>
>
>>
>> Each item has only one c...@name eq "a"] and one c...@name eq "b"] and one
>> c...@name eq "c"].
>
> Yes, I understand this. I meant something different.
>
> Please, run the following queries and send us results:
>
> 1. count(distinct-values(collection("samples")/root/item/c...@name =
> "a"]/text()))
> 2. count(distinct-values(collection("samples")/root/item/c...@name =
> "b"]/text()))
> 3. count(distinct-values(collection("samples")/root/item/c...@name =
> "c"]/text()))
>
>
> 3. count(distinct-values(collection("myChild")/root/item/c...@name =
> "a"]/text()))
> 4. count(distinct-values(collection("myChild")/root/item/c...@name =
> "b"]/text()))
> 5. count(distinct-values(collection("myChild")/root/item/c...@name =
> "c"]/text()))
>
>
--
Regards,
-Andrey
------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
Sedna-discussion mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sedna-discussion