Hi,
this isn't strictly on-topic, because it's not specific to Wikipedia, but you can probably help me with this.
1) When I load the downloaded SQL dump into MySQL, does it matter if I have already created the indices for the table, or is this detrimental?
2) If the answer to that is "It is detrimental", then: How do I remove those indexes? Apparently even if I delete the entire database and re-create it with just the 'cur' table, magically the indexes are still there.
Thanks, Timwi
On Feb 28, 2004, at 12:44, Timwi wrote:
- When I load the downloaded SQL dump into MySQL, does it matter if I
have already created the indices for the table, or is this detrimental?
Loading the dump drops any existing table of the same name and creates a new one. It doesn't matter what you've created, it'll be gone.
-- brion vibber (brion @ pobox.com)
Brion Vibber wrote:
On Feb 28, 2004, at 12:44, Timwi wrote:
- When I load the downloaded SQL dump into MySQL, does it matter if I
have already created the indices for the table, or is this detrimental?
Loading the dump drops any existing table of the same name and creates a new one. It doesn't matter what you've created, it'll be gone.
Have you read the rest of my posting? It's not gone, even if I delete the entire database and re-create it.
Timwi
Timwi wrote:
Have you read the rest of my posting? It's not gone, even if I delete the entire database and re-create it.
Are you sure this is the case? I've never noticed this behavior - but I might have not been paying attention. Double-check that the database actually gets dropped (see if the MYI/MYD/... files are gone from your mysql database directory after you drop it).
Cheers, Ivan
On Feb 28, 2004, at 19:46, Timwi wrote:
Brion Vibber wrote:
On Feb 28, 2004, at 12:44, Timwi wrote:
- When I load the downloaded SQL dump into MySQL, does it matter if
I have already created the indices for the table, or is this detrimental?
Loading the dump drops any existing table of the same name and creates a new one. It doesn't matter what you've created, it'll be gone.
Have you read the rest of my posting? It's not gone, even if I delete the entire database and re-create it.
Yes, I did read the rest of your posting, and it doesn't alter my response. It doesn't matter what the table you had previous did or didn't have in the way of indexes, as that table is dropped and no longer exists. The newly created table comes with indexes, so will have indexes regardless of what the dropped table did or didn't have.
The dump looks like this, you'll notice that the CREATE TABLE statement includes the index definitions:
-- MySQL dump 9.10 -- -- Host: localhost Database: enwiki -- ------------------------------------------------------ -- Server version 4.0.17-standard-log
-- -- Table structure for table `cur` --
DROP TABLE IF EXISTS cur; CREATE TABLE cur ( cur_id int(8) unsigned NOT NULL auto_increment, cur_namespace tinyint(2) unsigned NOT NULL default '0', cur_title varchar(255) binary NOT NULL default '', cur_text mediumtext NOT NULL, cur_comment tinyblob NOT NULL, cur_user int(5) unsigned NOT NULL default '0', cur_user_text varchar(255) binary NOT NULL default '', cur_timestamp varchar(14) binary NOT NULL default '', cur_restrictions tinyblob NOT NULL, cur_counter bigint(20) unsigned NOT NULL default '0', cur_is_redirect tinyint(1) unsigned NOT NULL default '0', cur_minor_edit tinyint(1) unsigned NOT NULL default '0', cur_is_new tinyint(1) unsigned NOT NULL default '0', cur_random double unsigned NOT NULL default '0', inverse_timestamp varchar(14) binary NOT NULL default '', cur_touched varchar(14) binary NOT NULL default '', UNIQUE KEY cur_id (cur_id), KEY cur_namespace (cur_namespace), KEY cur_title (cur_title), KEY cur_timestamp (cur_timestamp), KEY cur_random (cur_random), KEY name_title_timestamp (cur_namespace,cur_title,inverse_timestamp), KEY user_timestamp (cur_user,inverse_timestamp), KEY usertext_timestamp (cur_user_text,inverse_timestamp) ) TYPE=InnoDB PACK_KEYS=1;
-- -- Dumping data for table `cur` --
/*!40000 ALTER TABLE cur DISABLE KEYS */; LOCK TABLES cur WRITE; INSERT INTO cur VALUES (1,0,'AaA','#REDIRECT [[A]]\n','Automated conversion',0,'Conversion script','20020225154311','',8,1,1,0,0.116338664774167,'79979774845688',' 20030404053030'), [a hojillion lines snipped]
If this doesn't answer your question, I'm sorry.
-- brion vibber (brion @ pobox.com)
wikitech-l@lists.wikimedia.org