https://bugzilla.wikimedia.org/show_bug.cgi?id=15441

--- Comment #18 from Tyler Romeo <tylerro...@gmail.com> ---
If this is being actively worked on, I'd like to note one other thing that
should probably be changed along with this: a lot of our tables have primary
keys, but also don't at the same time. Basically, the maintenance/tables.sql
file doesn't list the table as having a primary key, but MySQL behavior is to
choose the first non-null unique key as use it as a primary key anyway. In
other words, the tables don't *look* like they have primary keys in their
definitions, but they actually do when created. It'd be simpler and less
misleading to just explicitly declare the primary keys.

Also, I'd like to note one thing about primary keys with InnoDB: all tables
have primary keys. If you don't specify one, as I said, MySQL will try and
choose a unique non-null index. But even if there is none of those, it will
create it's own "hidden primary key" using a custom 6-byte row id.
Unfortunately, this is really slow because the value for the next row id is not
per-table, but per-database. In other words, when inserting into any table
without an actual primary key, MySQL has to lock out all other similar tables
first in order to get a row id.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
Wikibugs-l mailing list
Wikibugs-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l

Reply via email to