Ever? Consider mysqldump + reload. The table was correctly UNIQUE
before the dump; nothing (in theory) could destroy the UNIQUEnes before
the reload finishes.
On 3/4/10 11:35 AM, Venu Kalyan wrote:
>> Why should unique checks ever be turned off? Wouldn't that violate the
>> UNIQUE constraint? Or at least delay it until too late to do a proper
>> ROLLBACK?
>>
> Well for many cases, its faster...when one is dumping and loading
> existing data; why should one go through the whole check when someone
> knows that there is no dups. Even internally alter table foo
> engine=MyISAM/InnoDB; should do the same by skipping validation part
> (wen re-creating the existing table)
>
> mysqldump also uses this mechanism...
> /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
>
> Thanks
> Venu
>
>
--
Rick James - MySQL Geek