+ Antworten
Ergebnis 1 bis 3 von 3

Thema: Index auf den Primary Key setzen

  1. #1
    TP-Veteran alexf812 macht alles soweit korrekt Avatar von alexf812
    Registriert seit
    Sep 2004
    Beiträge
    1.370

    Index auf den Primary Key setzen

    Hallo,

    wenn ich im phpmyadmin einen Index auf den Primary Key setze, dann bekomm ich ne Meldung, das beide gleich sind und ich einen Index entfernen kann.

    Bringt es denn was einen Index auf den Primary Key zu setzen. Aufgrund der warnung bin ich mir nicht sicher, ob es überhaupt so korrekt ist den Index zu setzen

  2. #2
    TP-Supporter Bruecksen hilft, wo's geht Bruecksen hilft, wo's geht Bruecksen hilft, wo's geht Avatar von Bruecksen
    Registriert seit
    Mar 2002
    Ort
    Stuttgart
    Beiträge
    370
    Bei einer MySQL DB wird automatisch ein Unique Index auf die PrimaryKey spalten gelegt.

    # A UNIQUE index creates a constraint such that all values in the index must be distinct. An error occurs if you try to add a new row with a key value that matches an existing row. For all engines, a UNIQUE index allows multiple NULL values for columns that can contain NULL.

    # A PRIMARY KEY is a unique index where all key columns must be defined as NOT NULL. If they are not explicitly declared as NOT NULL, MySQL declares them so implicitly (and silently). A table can have only one PRIMARY KEY. If you do not have a PRIMARY KEY and an application asks for the PRIMARY KEY in your tables, MySQL returns the first UNIQUE index that has no NULL columns as the PRIMARY KEY.
    http://dev.mysql.com/doc/refman/5.1/...ate-table.html

    Viele Grüße
    Matthias.
    http://www.bruecksen.de


  3. #3
    TP-Veteran alexf812 macht alles soweit korrekt Avatar von alexf812
    Registriert seit
    Sep 2004
    Beiträge
    1.370
    ok, danke für die Hilfe.
    Ich habe jedoch nur einen normalen Index angelegt, also im phpmyadmin einfach nur INDEX ausgwwäht undn icht UNIQUE... aber da ja schon nen Index angelegt ist brauch man ja keinen weiteren anlegen.

+ Antworten

Ähnliche Themen

  1. Link in php setzen ohne Änderung index
    Von Paco im Forum Traum-Dynamik
    Antworten: 43
    Letzter Beitrag: 12.09.2007, 12:51
  2. Primary master hard disk fail
    Von Phong im Forum Hardware
    Antworten: 8
    Letzter Beitrag: 19.11.2004, 18:39
  3. Wahlweise index.html oder index.php möglich?
    Von JoDo im Forum Server & Provider
    Antworten: 7
    Letzter Beitrag: 09.11.2004, 14:24
  4. index setzen (für formularfelder)
    Von zippy im Forum Flash & Multimedia
    Antworten: 2
    Letzter Beitrag: 04.10.2003, 15:29
  5. Antworten: 6
    Letzter Beitrag: 08.01.2003, 11:51

Aktive Benutzer

Aktive Benutzer

Aktive Benutzer in diesem Thema: 1 (Registrierte Benutzer: 0, Gäste: 1)

     

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51