Hello I work with BaseX in C++ and have a problem with the performance of my querys. I have got a Database with manny Xml files but there is for example one xml file that is imported from an csv file that looks like that.
<record>
<hsn>0005</hsn>
<tsn>486</tsn>
<factorycode>BMW 3/1</factorycode>
<description>318I</description>
<power>83</power>
<cubiccapacity>1796</cubiccapacity>
<typeapprovaldate>19910701</typeapprovaldate>
<xxx>1</xxx>
<mid>BMW00737</mid>
</record>
I have a simple Query statement that looks for every mid with the same hsn and tsn
for $mid in doc('database')//record
where $mid / hsn = '0005' and $mid / tsn = '404'
return $mid/mid
The problem is that it takes to long because the xml file contains to many records.
Is there a way to optimize my query or the xml file? I think Attribute Index could work but I dont know how to use it in my database http://docs.basex.org/wiki/Indexes