Hi!, i solve my last problem with image table.
I make this mysql script:
CREATE TABLE tmp_image ( img_name varchar(255) binary NOT NULL default '', img_size int(8) unsigned NOT NULL default '0', img_description tinyblob NOT NULL default '', img_user int(5) unsigned NOT NULL default '0', img_user_text varchar(255) binary NOT NULL default '', img_timestamp char(14) binary NOT NULL default '' );
INSERT INTO tmp_image(img_name, img_size, img_description, img_user, img_user_text, img_timestamp) SELECT DISTINCT img_name, img_size, img_description, img_user, img_user_text, img_timestamp FROM image;
DELETE FROM image;
INSERT INTO image(img_name, img_size, img_description, img_user, img_user_text, img_timestamp) SELECT DISTINCT img_name, img_size, img_description, img_user, img_user_text, img_timestamp FROM tmp_image;
DROP TABLE tmp_image;
And after, jeluf (thanks thanks thanks a lot :D) say to me to reindex table with this script located on maintenance/archive (hidde documented for friends...), patch-image_name_unique.sql.
Well, now i'm on 1.4.x :D, but i have a little problem with metanamespaces, on 1.3.11 i use on LocalSettings. php a variable wgMetaNamespace with value 'enciclopedia'.
On lastest updates (maded with help of brion, tim, dammit, and so so so more....if any time i get official LAMP certification, on sign we must be all ;P) works fine but now doesnt. Why? I cant find any about this.
I'm waiting for your replies. :D
Greets.
______________________________________________ Renovamos el Correo Yahoo! Nuevos servicios, más seguridad http://correo.yahoo.es
no lssi no lssi wrote:
I make this mysql script:
That script copies the entire table around twice. I'm curious to know how long that took (but then again, I don't really know how large the table is at all).
Much more efficient would be:
ALTER TABLE image ADD COLUMN tmp_id int auto_increment; ALTER TABLE image ADD UNIQUE INDEX (tmp_id); DELETE FROM image WHERE tmp_id IN (SELECT i2.tmp_id FROM image i1, image i2 WHERE i1.tmp_id<i2.tmp AND i1.img_name=i2.img_name); ALTER TABLE image DROP COLUMN tmp_id;
though I haven't tried if this works on MySQL.
Timwi
wikitech-l@lists.wikimedia.org