mapbox/mapbox-ios-sdk — pull request #505 by mglasgow (2014-09-21 03:05:24+00:00)
Title: perf improvement to RMDatabaseCache when counting existing tiles

The existing code in RMDatabaseCache specifies a column name. According to sqlite specs, this means sqlite will perform null-checks for values in this column and exclude them from the count.

tile_hash should never be null, so we can skip this null-check behaviour by specifying a wildcard.

On my sample database cache of 9000 tiles, time to tile count went from about 5-6 seconds down to almost instantaneous.