Re: SQL-Frage

Rico Koerner <[email protected]>
Newsgroups gmane.user-groups.linux.dresden
Message-ID <[email protected]>
Hallo Erik,

Am 20.02.22 um 15:58 schrieb Erik Schanze:
> Angelegt wurde die Tabelle mit dem Kommando:
> 
> CREATE TABLE IF NOT EXISTS $tabelle (
>      created timestamp NOT NULL default CURRENT_TIMESTAMP,
>      c180 int(12) unsigned default NULL,
>      c280 int(12) unsigned default NULL,
>      PRIMARY KEY  (created)
>      ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
> 
> Die Spalte "created" ist bei der Tabelle schon als "primary key"
> eingestellt. Lt. Wikipedia wird da automatisch ein Index angelegt. Hilft
> da zusätzlich noch einer?

Nein, ein weiterer Index auf dieselbe Spalte bringt nichts, höchstens in 
Kombination mit anderen Spalten, was aber in deinem Fall auch nicht 
nötig ist.

Gruß
Rico
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.