Přidat otázku mezi oblíbenéZasílat nové odpovědi e-mailemVyřešeno SQL - Je cudzí kľúč rovnocenný bežnému indexu z hľadiska indexovania?

Zaujímalo by ma, či cudzí kľúč dokáže nahradiť bežný index alebo je nutné vytvárať aj bežný index, ak už existuje cudzí kľúč. Zaujímalo by ma to hlavne pri MySQL a SQLite. Myslím, že nie, ale keď tak nad tým rozmýšľam, možno to nie je až taký nezmysel.

Jsou zobrazeny jen nové odpovědi. Zobrazit všechny
Předmět Autor Datum
V prípade MySQL sa taký index automaticky vytvorí, pokiaľ neexistuje, viď dokumentácia: MySQL requi… poslední
los 27.11.2013 18:45
los

V prípade MySQL sa taký index automaticky vytvorí, pokiaľ neexistuje, viď dokumentácia:

MySQL requires indexes on foreign keys and referenced keys so that foreign key checks can be fast and not require a table scan. In the referencing table, there must be an index where the foreign key columns are listed as the first columns in the same order. Such an index is created on the referencing table automatically if it does not exist. This index might be silently dropped later, if you create another index that can be used to enforce the foreign key constraint. index_name, if given, is used as described previously.

Zpět do poradny Odpovědět na původní otázku Nahoru