[Tile-serving] [openstreetmap/osm2pgsql] Store slim table tags in hstore (#692)

Paul Norman notifications at github.com
Tue Feb 28 01:14:48 UTC 2017


I did some testing, and the representation of tags in a hstore is more efficient than our current `text[]` array of alternating keys and values. For testing latter can be turned into the former with `hstore(tags)`.

Doing this on the slim table of a planet and summing the `pg_column_size` gives a size of 38GB for `text[]` representation and 30GB for `hstore`. The overall size of the current slim table is 94GB for the table and 190GB for the indexes so this is about a 5% space savings.

I considered jsonb, but it is the same size as hstore.

This change would require the hstore extension for osm2pgsql databases. I do not consider this an issue because hstore is a standard part of contrib, and many databases require it already.

In addition to being more efficient, if someone did want to use our internal slim tables to query by tag, it is much easier to do so with hstore.

-- 
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/issues/692
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/tile-serving/attachments/20170227/967a9773/attachment.html>


More information about the Tile-serving mailing list