[Wolves] Disable / enable keys slow in MySQL

Alex Willmer alex at moreati.org.uk
Wed Aug 5 21:54:57 UTC 2009


2009/8/5 DragonMaster <LUG at clews.homelinux.net>:
>> It depends a lot on what you're doing to the data.
>>
>> If you're doing a bulk insert (or perhaps update) then it would make
>> sense to disable the keys.
>
> The insert that I'm doing is actually very simple - it's an
>
> INSERT...ON DUPLICATE KEY UPDATE...

I'm not a MySQL expert, but the ON DUPLICATE KEY clause is almost
certainly causing a lot implicit selects. Without an index on the
primary key, each one of those inserts could be causing a full table
scan.

Alex
-- 
Alex Willmer <alex at moreati.org.uk>
http://moreati.org.uk/blog



More information about the Wolves mailing list