I'm struggling with indexes, primary keys and foreign keys... And the need of having them all.
If I have two tables, both of them have an integer as a primary key.
The first table references through a FK to the second table's primary key.
- On both tables I have a primary key index on the ID column
- I created a FK constraint on the
table1.ref_fieldreferencing the PK of the second table (
- and I added an index on
Is this the best way to organize these indexes, primary and foreign keys?