O
O
Oscar S2015-01-16 22:33:35
PHP
Oscar S, 2015-01-16 22:33:35

INSERT IGNORE: id grows unevenly. How to avoid it?

AUTO_INCREMENT does not grow evenly.
INSERT IGNORE INTO tbl (smth) VALUES (...), (...), (...), ...

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Dmitry Entelis, 2015-01-16
@DmitriyEntelis

On insert ignore, auto-increment id increments by default in innodb tables.
This can be fixed using the innodb_autoinc_lock_mode parameter, but with performance degradation.
In general, this is not a problem if your code requires the id to be non-breaking - you are most likely doing something wrong.

A
Armenian Radio, 2015-01-16
@gbg

Well, goblin with him, let him grow. Trying to do sequential numbering with gap control will create a bottleneck.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question