-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Missing Primary Key screws up DB Replication #2142
Comments
Adding it will cause a ton of breakage. Not sure how this fix should be done. |
I actually added an auto_increment field "id" and had no breakage using MySQL. Other databases, which are adding automatically primary keys when the are missing might be more affected. BUT: Shouldn't a primary key be obligatory? btw. the properties table is really under frequent access. We already have more than 300k entries in our test environment and not using an index results in a lot of full table scans. Setting an index reduced the number of accessed rows from 201.009 to 54.412 and the execution time from 0.16s to 0.07s when "explaining" on of the worse selects. The index is at about 12% of the size of the whole table. mysql> create index userid_index ON oc_properties (userid); |
see #2191 |
Ok, seems to be a very serious issue since there is not a single! field with primary key. I'll be asking on the mailing list if this is fixable in any way that doesnt make upgrading impossible. |
Most tables have primary keys from the autoincrement field, so afaik it is only the three tables mentioned above. |
tables that dont have a primary key (and neither auto increment):
by using sqliteman |
Could make appconfig_appid_key_index unique and primary
Could set file_map_lp_index as primary
has groups_pKey as primary
Could use id_user_index
Could use pref_userid_appid_key_index
Defines a primary key on users_pKey
Defines a primary key on category_object_index. |
Hi,
We are using a Galera cluster as a MySQL-DB backend. Within the db_structure.xml there are three tables without a Primary Key defined which leads to replication failures within the db cluster. This should also affect normal Master - Slave replication scenarios.
tables missing a Key:
group_user
group_admin
properties
As far as I can say those tables are a good candidate for an auto_increment field 'id', aren't they?
best regards
Roland Hager
The text was updated successfully, but these errors were encountered: