This way of doing stores integers as string, then call a cast string / integer to unserialize it. For large integer list (I am dealing with lists of size 134 Mo), it is quite time and mem consuming.
I was wondering if there exists a more efficient way to store and retrieve atomic list into BaseX ?
One alternative is to store the integers in a binary file:
let $size := 4 let $data := bin:join( for $n in 1 to 100 return bin:pack-integer($n, $size) ) return db:store('db', 'integers.bin', $data)
This way, every integer will occupy the supplied number of bytes (here: 4, allowing you to address 2^32 integers).