[Geopackage] Query on gpkg_tile_matrix - matrix_width and matrix_height

Pepijn Van Eeckhoudt pepijn at vaneeckhoudt.net
Thu Jun 4 08:46:17 EDT 2015

> I think the min/max SQL queries are fine. Perhaps some performance tests should be done on real world datasets to see how fast this query can be performed on a typical mobile device and desktop (will depend on presence or absence of indices on tile_row and tile_column of course).

I just did a quick test on the ERDC sample file. As you can see below SQLite performs this query using the automatic index that is created because tile_row and tile_column are part of the primary key of a tile user data table.

sqlite> explain query plan select min(tile_row),max(tile_row),min(tile_column),max(tile_column) from Whitehorse;
sele  order          from  deta
----  -------------  ----  ----
0     0              0     SCAN TABLE Whitehorse USING COVERING INDEX sqlite_autoindex_Whitehorse_1

Index only queries are pretty fast. On my (core i7 + ssd disk) this takes a couple of milliseconds. Don’t have a mobile device at hand to test this quickly.

sqlite> select min(tile_row),max(tile_row),min(tile_column),max(tile_column) from Whitehorse;
min(  max(tile_row)  min(  max(
----  -------------  ----  ----
0     162            0     161 
Run Time: real 0.003 user 0.002757 sys 0.000059

Best regards,

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opengeospatial.org/pipermail/geopackage/attachments/20150604/3b8e8da8/attachment.html>

More information about the Geopackage mailing list