XPath and JCR-SQL2 Performance Comparison

Source: Internet
Author: User

Recently, compare the query performance of xpath and JCR-SQL2 in jackrabbit, although JCR no longer recommends the use of xpath from version 2.0, but in terms of the query performance, XPath seems much higher than the JCR-SQL2

The following are the comparison results.

Test environment:

Jackrabbit 2.2.7

Windows 2003

4 GB memory

AMD athlon (TM) II X4 640 3.01 GHz processor

Data source:

1033 node records, including 917 files and 116 folders

Query comparison:

Test records

JCR-SQL2 (MS)

XPath (MS)

1

2328

187

2

2484

188

3

2500

188

4

2344

187

5

2328

203

6

2344

187

7

2484

203

8

2344

188

9

2343

203

10

2343

188

Average

2384

192

Query statement:

JCR-SQL2:

Select node. * from [krp: knode] As Node

Inner join [krp: krpacl] asacl on ischildnode (ACL, node)

Inner join [krp: kfolder] asparent on ischildnode (node, parent)

Wherecontains (ACL. [krp: browse], '1 ')

And issamenode (parent, '/krp/krepogroup [2]/krepository/kfolder ')

Order by node. [krp: folder] DESC

XPath:

// Krp/krepogroup [2]/krepository/kfolder/element (*, krp: kfolder) [kfolderacl/@ krp: browse = '1']

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.