| | 10 | '''Falscher Index in Tabelle coupons''' |
| | 11 | |
| | 12 | {{{ |
| | 13 | ALTER TABLE coupons DROP INDEX idx_coupon_code |
| | 14 | |
| | 15 | ALTER TABLE coupons ADD UNIQUE (coupon_code) |
| | 16 | }}} |
| | 17 | Sonst sind immer noch doppelte (wenn auch unwahrscheinlich) Gutscheincodes möglich. |
| | 18 | |
| | 19 | '''Falscher Index in Tabelle coupons_description''' |
| | 20 | |
| | 21 | Coupon kann in einer Sprache mehrmals in DB eingetragen werden. |
| | 22 | |
| | 23 | {{{ |
| | 24 | ALTER TABLE coupons_description DROP INDEX coupon_id |
| | 25 | |
| | 26 | ALTER TABLE coupons_description ADD PRIMARY KEY (coupon_id, language_id) |
| | 27 | }}} |
| | 28 | |
| | 29 | '''Fehlender Index in Tabelle Tabelle coupon_email_track''' |
| | 30 | |
| | 31 | Darf ein Gutschein mehrfach in der Tabelle coupon_email_track auftauchen? Ich bin mir da jetzt nicht sicher, meine aber nein. |
| | 32 | |
| | 33 | Falls ich recht habe fehlt dort ein Index: |
| | 34 | |
| | 35 | {{{ |
| | 36 | ALTER TABLE coupon_email_track ADD UNIQUE (coupon_id) |
| | 37 | }}} |
| | 38 | |
| | 39 | '''Tabelle countries''' |
| | 40 | |
| | 41 | Dürfen ISO-Codes mehrfach in der Tabelle vorkommen? Wenn nein fehlt auch hier (2x) Unique: |
| | 42 | |
| | 43 | {{{ |
| | 44 | ALTER TABLE countries ADD UNIQUE (countries_iso_code_2) |
| | 45 | ALTER TABLE countries ADD UNIQUE (countries_iso_code_3) |
| | 46 | }}} |
| | 47 | |
| | 48 | '''Tabelle customers_status''' |
| | 49 | |
| | 50 | {{{ |
| | 51 | ALTER TABLE customers_status DROP INDEX idx_orders_status_name |
| | 52 | ALTER TABLE customers_status ADD UNIQUE (customers_status_name, language_id) |
| | 53 | }}} |
| | 54 | |
| | 55 | Sonst können Kundengruppen mit dem gleichen Namen wie bestehende Kundengruppen angelegt werden. |
| | 56 | |
| | 57 | '''Tabelle products_vpe''' |
| | 58 | |
| | 59 | Die Tabelle products_vpe hat keinen Index. Meine Meinung: |
| | 60 | |
| | 61 | {{{ |
| | 62 | ALTER TABLE products_vpe ADD PRIMARY KEY (products_vpe_id, language_id) |
| | 63 | }}} |
| | 64 | |
| | 65 | '''Tabelle products_xsell_grp_name''' |
| | 66 | |
| | 67 | Gleiches für products_xsell_grp_name: |
| | 68 | |
| | 69 | {{{ |
| | 70 | ALTER TABLE products_xsell_grp_name ADD PRIMARY KEY (products_xsell_grp_name_id, language_id) |
| | 71 | }}} |
| | 72 | |
| | 73 | '''Tabelle customers''' |
| | 74 | |
| | 75 | Gehört in Tabelle customers nicht ein Index auf customers_email_address (und account_type)? Bei jeder Anmeldung erfolgt sonst immer ein Table-Scan. |
| | 76 | |
| | 77 | Was mich dabei auch noch stört, dass eine Prüfung, ob für eine Email-Adresse bereits ein Kundenkonto existiert nur im Code stattfindet/stattfinden kann und nicht durch Primary Key oder Unique in der Tabelle abgesichert ist. Das ist aber derzeit nicht möglich, da auch Gastkunden in diese Tabelle laufen und da kann die Email mehrfach vorkommen. |