Just to clarify, you meant to prepare the array for reading (with
TILEDB_READ, and not
The reason you are observing that is because that statement “opens” the array, loading all the fragment metadata. If your array is large, then the fragment metadata are expected to be fairly large as well, so it takes time to load and decompress them. Please note that this is an one-off cost: you should create the array object once, and then create multiple query objects passing that single array instance to avoid reloading the fragment metadata.
As another note, please note that we have just added an optimization on loading the fragment metadata. This is already in the
dev branch and scheduled for the 1.6 release over the next couple of days. Specifically, we now load the fragment metadata lazily during the reads (i.e., during the query submission).
Finally, we are planning to move to a full “out-of-core” fragment metadata implementation soon, where only a small fraction of relevant metadata is loaded upon a query, instead of all metadata as we do currently. So please expect this to be substantially improved over the next couple of months.