MySQL Forums
Forum List  »  General

Re: PK vs UK, and general indexing best practices
Posted by: Peter Brawley
Date: July 11, 2018 07:15AM

The one good reason I'm aware of for using MyISAM rather than InnoDB in modern MySQL/MariaDB for significant permanent tables is that the table needs frequent big Load Data inputs. Load Data with MyISAM is much faster. Usually in such cases the MyISAM table is a staging table. So failing that, I'd say move it to InnoDB yesterday.

Unique & Primary keys aren't the same. A UK can be null. The more such nulls there are, the more compromising the problem is---rows which can't be uniquely identified by the key. In InnoDB, absent a PK Innodb builds an internal pseudo-PK which works but is less efficient, less robust, makes more system demands than a PK. So best practice is to always have a PK, and in your case I agree an auto-inc PK would be just the ticket. Read about how InnoDB clustered and covering indexes work with PKs.

Options: ReplyQuote


Subject
Written By
Posted
Re: PK vs UK, and general indexing best practices
July 11, 2018 07:15AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.