Hi,
I am wondering whether it is possible to use indexes in a script even if a database is not created explicitly/previously. I see that sometimes, when comparing different XML texts accessed via doc(), text indexes are automatically created/used, but it is not clear to me whether/how I can specify/force the use of them also in the script. Thanks.
Best, Giuseppe
Hi Giuseppe,
I am wondering whether it is possible to use indexes in a script even if a database is not created explicitly/previously. I see that sometimes, when comparing different XML texts accessed via doc(), text indexes are automatically created/used, but it is not clear to me whether/how I can specify/force the use of them also in the script. Thanks.
That’s correct: Text and attribute indexes are created for all documents that are read into main-memory, and queries are rewritten to utilize these indexes whenever possible and reasonable. A positive side-effect of this is that all texts are only kept in memory once, and the actual XDM tree works exclusively with index references.
There is no way to directly address these transient indexes in your query. Do you have a specific use case in mind for which you believe it would speed up your query?
Ciao Christian
Best, Giuseppe
basex-talk@mailman.uni-konstanz.de