On Tue, Jun 21, 2016 at 9:02 PM, Guillaume Lederrey
<glederrey(a)wikimedia.org> wrote:
Hello!
I need some feedback from my fellow Ops on how to manage indexes on Maps.
Context:
Maps imports OpenStreetMap data in a Postgresql database. This import
is done with osm2pgsql, which takes care of creating the schema,
populating tables and creating a few indexes.
Some additional indexes are required to support the specific
functionalities of Tilerator. So far, those indexes have been created
manually and have not been tracked.
The enhancements to the schema created by osm2pgsql are minor (a few
index and functions), so we probably need a lightweight solution.
Proposal:
A few idempotent scripts are versionned in osm-bright.tm2source [1].
Those scripts are executed after review by Ops, at the request of the
project. We don't use a full schema migration process, because at this
point there isn't really a need for it on this project.
Does this look reasonable to you? Feedback welcomed, shoot me down if
you have to...
My very naive first level suggestion would be to run a wrapper around
osm2pgsql and (re-)add the indexes via this wrapper once osm2pgsql has
completed successfully.
Also, if such schema optimizations have general interest, it would be
nice to try to get them integrated into osm2pgsql.
But I can be missing some context here!
Cheers
Giuseppe
--
Giuseppe Lavagetto, Ph.d.
Senior Technical Operations Engineer, Wikimedia Foundation