Wednesday, April 16

Geek

Pixy's Actually Useful Tip Of The Day, Part Two

If you INSERT IGNORE into a MySQL table with an auto-increment primary key, the counter will increment even if the INSERT is IGNORED due to a duplicate secondary index.

And if you're abusing this process in horrible ways, you can pretty quickly wrap a 32-bit int, in which case all your INSERTS will be IGNORED.

Solution: Use a 64-bit int.

Hey, I'm not saying it's a good solution.

Posted by: Pixy Misa at 06:20 PM | No Comments | Add Comment | Trackbacks (Suck)
Post contains 77 words, total size 1 kb.

Comments are disabled. Post is locked.
45kb generated in CPU 0.0124, elapsed 0.1044 seconds.
54 queries taking 0.0952 seconds, 325 records returned.
Powered by Minx 1.1.6c-pink.