[Openstreetmap-dev] Database select sql statement for getting nodes

Immanuel Scholz immanuel.scholz at gmx.de
Wed Nov 30 12:40:44 GMT 2005


Hi,

> - second the FOO-line: From BAR (the list of all nodes in timestamp
> order), all nodes selected again, grouped by uid.
> If uid is unique, this does not have any effect. FOO equals to BAR.
> If uid in not unique, it only changes the order of appearance, putting all
> entries with the same uid together.

Ok, I have spotted my mistake. Of course, "group by" does not just order
the elements but select only the first one. "uid" is not unique, since the
complete history of entries are stored within the same table. All entries
with the same uid belong to the same history of the object with that uid.

So it selects the first (newest) of all nodes that have any reference in
the bounding box. In the final select, it subselect only those entries
that are not deleted (visible=true) and that are still in the bounding
box.


Ciao, Imi.






More information about the dev mailing list