[OSM-dev] way 7062297, is this new?

Brett Henderson brett at bretth.com
Thu Oct 9 04:56:05 BST 2008


On Thu, Oct 9, 2008 at 1:44 PM, Ian Dees <ian.dees at gmail.com> wrote:

> On Wed, Oct 8, 2008 at 9:35 PM, Stefan de Konink <stefan at konink.de> wrote:
>
>>
>>
>> No way! The database[1] uses indexing under the hood automatically. So
>> every created_by k or JOSM v is automatically indexed. This gives a
>> significant space reduction plus fast lookup.
>>
>> Next to that it is very easy now to do lookups like done in OSMXAPI,
>> which I wrote my own implementation for.
>>
>>
> So you do want to use tag lookups. Ok, just add an extra numeric value to
> your primary key of {wayid,k} so that it looks like {wayid,k,number}. When
> you insert, look for duplicate tag keys and change the "number" when you
> find a duplicate.
>

I had the same issue with the osmosis pgsql schema.  To get around the
problem I didn't create a public key for the table.  Instead I created a
non-unique index on the way_id column to allow efficient retrieval of tags
for a way.

The table definition (PostgreSQL) looks like this:
CREATE TABLE way_tags
(
  way_id bigint NOT NULL,
  k text NOT NULL,
  v text
);
CREATE INDEX idx_way_tags_way_id
  ON way_tags
  USING btree
  (way_id);
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/dev/attachments/20081009/f5e1198c/attachment.html>


More information about the dev mailing list