[OSM-dev] Simple tag count analysis
Tom Hughes
tom at compton.nu
Fri Aug 3 15:17:07 BST 2007
In message <a4c775140708030710p2208dd8bvc2bf236791539766 at mail.gmail.com>
Dave Stubbs <osm.list at randomjunk.co.uk> wrote:
> I've hacked together a tag count analysis page for the osm site.
> I have my development machine running a demo:
> http://beerwarmer.randomjunk.co.uk:3000/tags/keys
>
> The development machine currently only has the UK data loaded into
> it's DB, is only a laptop, and is over an adsl connection, so that
> link will be up-and-down like a yo-yo, but it gives the idea
> hopefully.
>
> I've attached the svn patch to add this (I don't have svn access, and
> have no idea whether people would actually want this deployed for
> real).
> I've only been doing rails (and ruby for that matter) about 16 hours
> now, so let me know if I've done anything stupidly ;-)
>
> Currently the code works live off of the current_way_tags table.. so
> on the real site it would update in real-time with the stats.
Unfortunately current_way_tags is a MyISAM table, and can't be made
into an InnoDB table as it has a full text index which InnoDB does not
support.
What that means is that any query locks the whole table, so doing a
group by over the whole thing like your code does, which takes about
thirty seconds currently on the live database, blocks all updates to
the table while it is running.
Tom
--
Tom Hughes (tom at compton.nu)
http://www.compton.nu/
More information about the dev
mailing list