Changes between Version 3 and Version 4 of Ticket #366


Ignore:
Timestamp:
Feb 13, 2015, 1:15:38 PM (11 years ago)
Author:
Torsten Riemer
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #366

    • Property Reporter changed from anonymous to Volker Strähle
    • Property Summary Doppelter Index in coupon_gv_customerFehlende bzw. falsche Indizes
  • Ticket #366 – Description

    v3 v4  
     1Zusammenfassung aus dem Thema: [http://www.modified-shop.org/forum/index.php?topic=32245.0 Bug-Jagd - Fehlende bzw. falsche Indizes]
     2
     3'''Doppelter Index in  coupon_gv_customer'''
     4
    15Auf der Spalte customer_id liegt 2x ein Index - einmal als Primary Key (=richtig) und einmal als normaler Index (=falsch).
    26
     
    48ALTER TABLE coupon_gv_customer DROP INDEX customer_id
    59}}}
     10'''Falscher Index in Tabelle coupons'''
     11
     12{{{
     13ALTER TABLE coupons DROP INDEX idx_coupon_code
     14
     15ALTER TABLE coupons ADD UNIQUE (coupon_code)
     16}}}
     17Sonst sind immer noch doppelte (wenn auch unwahrscheinlich) Gutscheincodes möglich.
     18
     19'''Falscher Index in Tabelle coupons_description'''
     20
     21Coupon kann in einer Sprache mehrmals in DB eingetragen werden.
     22
     23{{{
     24ALTER TABLE coupons_description DROP INDEX coupon_id
     25
     26ALTER TABLE coupons_description ADD PRIMARY KEY (coupon_id, language_id)
     27}}}
     28
     29'''Fehlender Index in Tabelle Tabelle coupon_email_track'''
     30
     31Darf ein Gutschein mehrfach in der Tabelle coupon_email_track auftauchen? Ich bin mir da jetzt nicht sicher, meine aber nein.
     32
     33Falls ich recht habe fehlt dort ein Index:
     34
     35{{{
     36ALTER TABLE coupon_email_track ADD UNIQUE (coupon_id)
     37}}}
     38
     39'''Tabelle countries'''
     40
     41Dürfen ISO-Codes mehrfach in der Tabelle vorkommen? Wenn nein fehlt auch hier (2x) Unique:
     42
     43{{{
     44ALTER TABLE countries ADD UNIQUE (countries_iso_code_2)
     45ALTER TABLE countries ADD UNIQUE (countries_iso_code_3)
     46}}}
     47
     48'''Tabelle customers_status'''
     49
     50{{{
     51ALTER TABLE customers_status DROP INDEX idx_orders_status_name
     52ALTER TABLE customers_status ADD UNIQUE (customers_status_name, language_id)
     53}}}
     54
     55Sonst können Kundengruppen mit dem gleichen Namen wie bestehende Kundengruppen angelegt werden.
     56
     57'''Tabelle products_vpe'''
     58
     59Die Tabelle products_vpe hat keinen Index. Meine Meinung:
     60
     61{{{
     62ALTER TABLE products_vpe ADD PRIMARY KEY (products_vpe_id, language_id)
     63}}}
     64
     65'''Tabelle products_xsell_grp_name'''
     66
     67Gleiches für products_xsell_grp_name:
     68
     69{{{
     70ALTER TABLE products_xsell_grp_name ADD PRIMARY KEY (products_xsell_grp_name_id, language_id)
     71}}}
     72
     73'''Tabelle customers'''
     74
     75Gehört in Tabelle customers nicht ein Index auf customers_email_address (und account_type)? Bei jeder Anmeldung erfolgt sonst immer ein Table-Scan.
     76
     77Was 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.