Someone on the list gave me following tip:
*********************************************************
for $i in index-scan("chemicalcontent_id", "", "GE")/@id return string($i) - as a result, you will get the keyset of an index, maybe with duplicate keys (if they are presented in index), which can be removed with distinct-values function.
Here, the blank key to compare with ( "" ) assumed to be less than any other key in index.
*********************************************************
But I tried that and it still is not responsive. I think Sedna is not using the index only but still doing a full collection scan. Can someone shed some light on this?
I was also looking a bit into the documentation for how to run an explain plan. But to my surprise I don't see anything back of index usage. It's something I would typically expect from an explain plan.
http://www.sedna.org/progguide/ProgGuidesu10.html#x16-640002.7.3
To give an example, I have following index and xquery module
*******************************************************************
create index "package_id"
on fn:collection("packages/released")/Package
by @identifier
as xs:string
*******************************************************************
module namespace packages = "http://www.nxp.com/packages";
declare function packages:getPackage($id as xs:string) as element(Package)? {
index-scan('package_id', $id, 'EQ')
};
*******************************************************************
Now I tried to explain a method invocation that uses a index:
*******************************************************************
explain
import module namespace packages = "http://www.nxp.com/packages";
packages:getPackage("SOT669")
*******************************************************************
It shows me following explanation, but no evidence of an index being used.
*******************************************************************
<prolog xmlns="http://www.modis.ispras.ru/sedna"/>
<query xmlns="http://www.modis.ispras.ru/sedna">
<operation name="PPQueryRoot">
<operation name="PPFunCall" id="0" function-name="packages:getPackage" position="3:1">
<operation name="PPConst" type="xs:string" value="SOT669" position="3:21"/>
</operation>
</operation>
</query>
*******************************************************************
So any tips on debugging my performance problem are very welcome !!
Thx in advance,
Robby
-----Original Message-----
From: Robby Pelssers [mailto:rob...@nx...]
Sent: Thursday, January 10, 2013 12:09 PM
To: sed...@li...
Subject: [Sedna-discussion] poor performance for large collection
Hi all,
I have a single collection of 24468 documents.
<count>{count(collection("chemicalContent/released")/TypeName)}</count> == 24468
When I just try to run below statement it takes very long to execute. The documents themselves are not even that big varying between 2kb and 12kb.
for $i in collection("chemicalContent/released") return document-uri($i)
I also have a index on that collection:
create index "chemicalcontent_id"
on fn:collection("chemicalContent/released")/TypeName
by @id
as xs:string
Is it normal for that statement to execute that long (> 1 minute) ?
Is there a way to perhaps speed up fetching a list of all @id's for that particular collection?
Thx in advance,
Robby
------------------------------------------------------------------------------
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS, MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft MVPs and experts. ON SALE this month only -- learn more at:
http://p.sf.net/sfu/learnmore_122712
_______________________________________________
Sedna-discussion mailing list
Sed...@li...
https://lists.sourceforge.net/lists/listinfo/sedna-discussion
|