On Thu, Feb 21, 2008 at 5:30 PM, Simetrical
<Simetrical+wikilist(a)gmail.com> wrote:
On Thu, Feb 21, 2008 at 12:21 PM, Alex Powell
<alexp(a)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.
Yes live updates could go to both tables, or you can just do batch
updates in the scripts that catch up with the live table. The main
idea is not to lock the table to writes - I presumed that it would
affect the site, as how do edits proceed whilst the table is locked??
RE MySQL I expect that its a hard bit of code for a diminishingly
small number of users (qv most mediawiki updates only targeted at core
audience). After all alter table on a few hundred thousand record
table is still quite quick. Maybe the later versions are better at
this?
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.
Yes, true. More thinking out loud, as its a problem that I have had to
deal with on a day to day basis (and am not happy with the solution).