Hi Clemens,
I guess that in this case the query planer uses the text index (as indicated in the Query Info as well), and then only needs to check on the parents of the few results returned by the first query if they satisfy the where clause.
Exactly.
Would it theoretically be possible to write the query in a way that both the text index and the attribute index are being used
Absolutely, it could e.g. look like this:
let $texts := db:text('classification', ('F0723EZ', '...'))/ parent::value/parent::code/parent::classification let $attributes := db:attribute('classification', 'some-name')/ parent::classification[@year = '2017'] return $texts intersect $attributes
Cheers, Christian