4 ms·
Sounds like a great case for Postgres hstore (like OpenStreetMap does it)?
by dbrgn 9y ago
Sounds like a great case for Postgres hstore (like OpenStreetMap does it)?
- rickycook 9y agoi think that’s basically what it was designed for :p
- stu432 9y agoI mean, not really, theres no magic in Postgres' implementation of the pattern. They even spell it out for you: "can be useful in various scenarios, such as rows with many attributes that are rarely examined" They are querying these quite heavily, they aren't just random attributes they need to retrieve.
- dbrgn 9y agoYou're right, I think most OSM databases extract the most commonly used keys into dedicated, potentially indexed columns.
- bpicolo 9y agohstore querying is quite slow (and GIN indexes on hstores are pretty massive). I'd always go jsonb over hstores these days, but jsonb has the same indexing problem. JSON has a well-optimized/spec compliant serializer/deserializer in every language you can imagine as a baseline, whereas hstore does not.