[OSM-dev] mysql partitioning
Simon Hewison
simon at zymurgy.org
Wed Aug 30 15:33:39 BST 2006
Nick Hill wrote:
> However, most of the database time seems to be spent pulling segments
> from the database. For every node in the selected area, an index look-up
> is performed for segments associated with that node. Then for segments
> which have only one node associated with them, the other node is
> downloaded. This is very, very db intensive.
Why do we even have such segments with only one node associated with them in
the database? The only time I've ever seen them is where somehow there's two
nodes bang on top of each other, and an editor has got a little bit confused
as to what the user was pointing at.
Another rather nasty thing I've spotted is that when the new renderer is
working out what tags are on ways attached a list of segments. It seems to
be doing lots of individual calls for each row in get_multis_from_segments()
, because it's calling out to get_multi() for each of those.
I can see that those multiple SQL transactions could be reduced, with all
the overhead of parsing SQL queries, by writing it as one SQL query.
Admittably, it looks like get_multi() was written with area support in mind,
which might complicate it a bit.
--
Simon Hewison
More information about the dev
mailing list