MySQL Forums
Forum List  »  German

Re: Wird Abfrage durch view-Tabellen gebremst?
Posted by: Alwin Bekker
Date: June 01, 2011 10:52AM

Hallo Thomas,

mein Fremdschlüssel ist auch gleichzeitig ein Primärschlüssel:

create table personen
(
personen_id int unsigned not null auto_increment primary key,
name varchar(25) not null,
standort_id smallint unsigned not null references standort(standort_id)
) engine = InnoDB;

create table projekte
(
projekt_id smallint unsigned not null auto_increment primary key,
projekt_name varchar(25) not null
) engine = InnoDB;

create table personen_projekte
(
personen_id int unsigned not null references personen(personen_id),
projekt_id smallint unsigned not null references projekte(projekt_id),
primary key(personen_id, projekt_id)
) engine = InnoDB;

Sollte da nicht ohnehin ein Index drauf sein?



Edited 2 time(s). Last edit at 06/01/2011 10:55AM by Alwin Bekker.

Options: ReplyQuote




Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.