Joins

Relational databases are designed to optimize joins, so DataDirect XQuery® leverages the database when an XQuery join involves SQL data. Performing all the joins in the database results in a dramatic performance gain, because DataDirect XQuery simply uses the SQL engine in your database.

Example 4. Join Pushdown

XQuery

for $u in collection('USERS')/USERS
for $h in collection('HOLDINGS')/HOLDINGS
where $u/USERID = $h/USERID
return <holding name="{$u/LASTNAME}">{$h/SHARES/text()}</holding>

Generated SQL

SELECT ALL
nrm5."LASTNAME" AS RACOL1,
nrm9."SHARES" AS RACOL2
FROM
"PEPPINO"."USERS" nrm5,
"PEPPINO"."HOLDINGS" nrm9
WHERE
nrm5."USERID" = nrm9."USERID" AND
LENGTH(nrm5."USERID") = LENGTH(nrm9."USERID")

Try DataDirect XQuery® Free!

Put the power, scalability, and performance of DataDirect XQuery® to work for you today! Our free trial lets you see for yourself how easy it is to build data integration applications that access relational, EDI, and other file formats as XML!

Download DataDirect XQuery® today!

Online Video Tutorials!

Our easy-to-follow online video tutorials are a great way to get acquainted with the many features of DataDirect XQuery®.

And if you like what you see, download a free copy today and try DataDirect XQuery® for yourself!