On Thu, Feb 21, 2008 at 12:21 PM, Alex Powell alexp@exscien.com wrote:
Why not alter mw code to allow for dynamic table renames of any table (at present only user is covered). Then you can create a new table with the correct structure and move the records from one to another, before discontinuing the old table?
I'm not clear how you want this to proceed. Like having all updates, inserts, etc. be done to both tables at once, while the population is ongoing? I can't see why that wouldn't work, I admit. I don't know if it would be incredibly useful to Wikimedia, though, since alter table doesn't actually disrupt the site or anything. It's just kind of a pain. If anything it would be more useful to third parties.
I guess one question to ask is why MySQL can't do this transparently already. Maybe there's some drawback or catch I'm missing.
This could have other benefits, as you could potentially share tables between wikis easier (though there is no way to identify which wiki... maybe theres a hook I could use for that). Basically I run a bunch of wikis and have unified certain aspects of the DB through hooks - writing categories, pages and search to a central store at present, keyed by original db id and wiki id. This allows me to search across wiki boundaries, but maintain wikis atomically (useful for security).
I don't see how this is related. It would require additional work on top of the previous suggestion, at the very least, to allow modification of the query in addition to its replication.