[Talk-GB] Drinking Map of UK

Graham Jones grahamjones139 at gmail.com
Mon Nov 7 19:24:23 GMT 2011


Hi Jonathan,

> I don't claim to be an osm2pgsql expert, but I think that's a
> misunderstanding of the situation. I think *any* new tag added to osm.xml
> results in an extra column, whether it has a colon or not.
>
You are right, the colons are not significant.  What I should have said is
that I do not like inventing new keys when they are not necessary because
they end up needing to be an extra column in the database - adding a colon
to an existing key may appear to be some sort of lower level in a
hierarchy, but as far as I can tell it is just creating a new key that
looks similar to the existing one - at least in the osm2pgsql schema.

In this specific case we have two options:
         - craft = brewery
         - craft = cider
         - craft = brewery; cider etc. etc...

or
         - craft:brewery = true
         - craft:cider = true

both achieve the same thing, but the first uses only a single, pre-existing
key, whereas the second creates two new ones.
If the second version ended up storing boolean values, I could see an
argument for it because it could reduce storage space, but everything is
just text, so there is not much in it.


>
> Generally you shouldn't consider any performance implications when
> creating a tag, because you don't know what will change in the next version
> of the code. The easy-for-mappers-but-maybe-a-**bit-computationally-intensive
> scheme you're trying to avoid may become a non-issue with a few lines of
> code changed. Equally the opposite may happen.
>
> Not too sure about that - I don't think either of the options is
significantly harder for mappers!


> For information, I'm assured that extra columns produce next to no
> performance degradation anyway since osm2pgsql started using hstore.

I am thinking about scrapping my hstore enabled database because things
seem to have got a lot slower since I added it, but might do a bit more
testing first.....

It is as much about neatness as performance - with a simple 'craft=' schema
I can have a single sql query that extracts everything with a craft= tag,
then just filter on the value of craft to decide how to render it.   With
craft, craft:brewery, craft:cider etc., they will each need a  different
bit of sql.

All quite possible, just the simpler one seems neater to me.

Graham.

-- 
Graham Jones
Hartlepool, UK.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/talk-gb/attachments/20111107/44f70574/attachment.html>


More information about the Talk-GB mailing list