Impact on Insert Performance — Primary Keys in #mysql
▻https://hackernoon.com/impact-on-insert-performance-primary-keys-in-mysql-590ecf8ba67?source=rs
Impact on Insert Performance — Primary Keys in MySQLThe importance of Primary Keys in MySQLNote: I have used MySQL and it’s storage engine #innodb interchangeably.A couple of days ago, someone at work asked me whether inserts are faster in a table when there’s a primary key present in the table. My immediate answer was that they were faster. I had some idea about this from experience and previous reading but didn’t remember the reason why it was so.For a business user unaware about InnoDB internals or InnoDB’s existence, it might seem perfectly intuitive to assume that inserts will be faster without a primary key because a primary key is an additional constraint on the table, i.e., MySQL has to check for uniqueness, nullability. When it comes to InnoDB, that is not the case. Also, a table (...)