Alright, which is faster and better to use?
Auto_increment
or
Call an sql which which does a max and then add one
So ultimately the question is should you use mysql to do it or do it yourself?
Definitely auto-increment. The SQL you would write is not thread-safe, and would only apply to the data that enters through your specific stored procedure/sql.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With