When I make ER diagram in MySQL Workbench
the software makes automaticly multiple foreign key columns where I would have expected just one foreign key:
In the image you see the following foreign keys with multiple columns:
fk_city_state1
in table city: state_state_id + state_country_country_idfk_district_city1
in table district: city_city_id + city_state_id + city_state_country_idfk_street_district1
in table street: district_district_id + district_city_city_id + district_city_state_id + district_city_state_country_country_id
From this post I learned that Workbench
does this for index purposes.
When I make such an ER diagram in pgAdmin 4
these extra foreign key columns aren't added. Is this about how advanced is the pgAdmin 4
tooling or isn't it a good practise in PostgreSQL
? With other words: is it a good idea to add these extra columns as foreign keys and put an Auto FK Index
on them?