[Tile-serving] [openstreetmap/osm2pgsql] Gazetteer: use hstore column for address parts (#737)
Christian von Roques
notifications at github.com
Mon Apr 17 13:30:44 UTC 2017
I'm not convinced that this is a desirable change. Yes, having the whole address as one `hstore` value is probably nicer to pass around, but is this comfort worth the cost?
I've spent some time looking into the innards of Nominatim and reducing its storage requirements and cache footprint by choosing smaller types and playing "column Tetris". These changes had a nice effect on freshly loaded, indexed, and VACUUM FULLed extracts of Germany, Switzerland, and Italy:
table | original | tetris | tetris + hstore-address
----- | -------- | ----- | ----------------------
place | 8522 MB | 8310 MB | 9367 MB
placex | 16693 MB | 15519 MB | 16757 MB
But, as you can see the space wasted by using `hstore` for address outweighs my savings.
An `hstore` uses 1 + 4 + 2×N×4 + size(keys) + size(values) (+3 (if more than 63)) bytes to store N key/value pairs. This sums up to 23 wasted bytes for each housenumber alone. Whereas adding an additional column just takes one bit (in the null-map) + size(value) if not NULL (when properly aligned).
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/osm2pgsql/pull/737#issuecomment-294485823
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/tile-serving/attachments/20170417/3878497a/attachment.html>
More information about the Tile-serving
mailing list