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.
44kb generated in CPU 0.0512, elapsed 0.6422 seconds.
54 queries taking 0.6351 seconds, 337 records returned.
Powered by Minx 1.1.6c-pink.