XML Editor
Sign up for a WebBoard account Sign Up Keyword Search Search More Options... Options
Chat Rooms Chat Help Help News News Log in to WebBoard Log in Not Logged in
Conferences Close Tree View
+ Stylus Studio Feature Requests (1192)
+ Stylus Studio Technical Forum (14621)
+ Website Feedback (249)
+ XSLT Help and Discussion (7625)
- XQuery Help and Discussion (2017)
-> + XQUERY RESULTS NOT IN PROPER F... (2)
-> + how to get data from database ... (2)
-> + tree view in xquery (2)
-> + Need help with SelectsingleNod... (5)
-> - counting in query (1)
-> + WebApplication with Xquery (3)
-> + Limit to number of elements in... (3)
-> + Automate xquery Conversion (2)
-> + ddtek:wscall problem (2)
-> - Problem with case sensitive (1)
-> + Is this the formal tech suppor... (2)
-> + problem with Conditional Expre... (5)
-> - problem with Conditional Expre... (1)
-> + connect to mysql for xquery? (2)
-> - NOOB Help (1)
-> - Getting rid of empty namespace... (1)
-> + Xquery not yielding results (3)
-> - fn:replace() inserting spaces ... (1)
-> + Xquery XML document with spcei... (7)
-> + XLS (MS Excel) to XML Converte... (3)
-- Previous [61-80] [81-100] [101-120] Next
+ Stylus Studio FAQs (159)
+ Stylus Studio Code Samples & Utilities (364)
+ Stylus Studio Announcements (113)
Topic  
Postnext
David IsaacSubject: Nested XQuery FLOWRs with RDBMS joining all tables?
Author: David Isaac
Date: 27 Jul 2009 03:46 PM
Hello-

I'm hoping someone can help me improve performance of an XQuery against a relational database source using the DataDirect processor and drivers. I have four key tables, say Employee, EmployeeRecord, EmployeeRecordDetail, and AdditionalInfo. So my query looks something like this:

for $emp in collection("Employee")
return
<emp info...>
for $rec in collection("EmployeeRecord")
where $rec/SSN = $emp/SSN
return
<emp record info...>
for $detail in collection("EmployeeRecordDetail")
where $rec/recId = $detail/recId
return
<emp record detail...>
for $additional in collection("AdditionalInfo")
where $detail/recId = $additional/recId and ...other join info
return
<additional detail info.../>
</emp record detail>
</emp record info>
</emp info>

The query plan shows that, for each FLOWR, Stylus joins all tables in the where clause plus all tables in the where clause of all parent FLOWR statements. So in the inner most loop, I get a join like this:

select...from Employee, EmployeeRecord, EmployeeRecordDetail, AdditionalInfo...

Although Stylus seems to only be getting the rowId of the parents, this still seems to be causing performance problems: I let the query run all weekend and it never finished. My test database has:

10,000 employees
11,000 employee records
100,000 employee record details
10,000 additional info rows

My real database has 100x this much information. I think it would help if I could force Stylus to leverage the database to only get the info for each employee as needed, rather than all at once, by eliminating the parents from the joins and using the parent references as a constraint on a repeated query (e.g., where SSN = $outerLoopSSN).

Any suggestions would be greatly appreciated...this is a show stopper for our project.

Postnext
Minollo I.Subject: Nested XQuery FLOWRs with RDBMS joining all tables?
Author: Minollo I.
Date: 28 Jul 2009 08:32 AM
To start, we’ll need some additional information:
- The database and version
- Which version of DDXQ being used
- A copy of the table DDL and even better some sample data
- The actual XQuery you are running

Posttop
Ivan PedruzziSubject: Nested XQuery FLOWRs with RDBMS joining all tables?
Author: Ivan Pedruzzi
Date: 29 Jul 2009 02:58 PM

try using a single for

for $emp in collection("Employee"),
,$rec in collection("EmployeeRecord")
,$detail in collection("EmployeeRecordDetail")
,$additional in collection("AdditionalInfo")

where $rec/SSN = $emp/SSN
and $rec/recId = $detail/recId
and $detail/recId = $additional/recId

return
Ivan Pedruzzi
Stylus Studio Team

   
Download A Free Trial of Stylus Studio 6 XML Professional Edition Today! Powered by Stylus Studio, the world's leading XML IDE for XML, XSLT, XQuery, XML Schema, DTD, XPath, WSDL, XHTML, SQL/XML, and XML Mapping!  
go

Log In Options

Site Map | Privacy Policy | Terms of Use | Trademarks
Stylus Scoop XML Newsletter:
W3C Member
Stylus Studio® and DataDirect XQuery ™are from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2016 All Rights Reserved.