Text index

Thursday, 12 December 2019 · 2 messages
GC
Giuseppe G. A. Celano12 Dec 2019 09:05 #
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
CG
Christian Grün12 Dec 2019 10:45 #
Hi Giuseppe,
Quoted text · Giuseppe G. A. Celano · 1 line
> 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
Quoted text · Giuseppe G. A. Celano · 3 lines
> > Best, > Giuseppe

⚡Generated with XQuery