Hi Vincent, hi Alex,
I am glad to report that with BaseX 8.6 the distinct values of numeric elements and attributes will also be stored in the index. You are invited to check out the latest stable snapshot [1].
Cheers, Christian
[1] http://files.basex.org/releases/latest/
On Mon, Jul 11, 2016 at 10:56 PM, Alex Muir alex.g.muir@gmail.com wrote:
On Mon, Jul 11, 2016 at 7:17 PM, Lizzi, Vincent Vincent.Lizzi@taylorandfrancis.com wrote:
I have a similar situation in which I want to get all distinct values of a specific attribute. I’ve tried using 2 different approaches: group and distinct-values. On small or medium size databases group tends to be faster. When trying to get distinct values of a specific attribute from large databases however both approaches are timing out for me. I’m looking for a way to optimize this query:
distinct-values(for $db in db:list() return distinct-values(db:open($db)//@sec-type))
With the current logic available it look possible given an attribute index on sec-type to associate a prefix onto the attribute value prior to insertion into the database like sec-type="type:13F" with the prefix type: and then use index:texts("dbname","type:") to get a distinct list of types all be it with a prefix that would need adjusting logic in using that data or querying.
Regards Alex tech.jahtoe.com bafila.jahtoe.com