If I have a schema like this:
profile_network
---
id profile_id(fk) school_type_id(fk) school_major_type_id(fk) school_degree_type_id(fk)
And a query that will always be used to join all of those to their respective lookup tables:
LEFT JOIN "profile_network" ON "profile_network"."profile_id" = "profile"."id"
LEFT JOIN "profile_network_school_type" ON "profile_network:school_type"."id" = "profile_network"."school_type_id"
LEFT JOIN "profile_network_school_major_type" ON "profile_network:school_major_type"."id" = "profile_network"."school_major_type_id"
LEFT JOIN "profile_network_school_degree_type" ON "profile_network:school_degree_type"."id" = "profile_network"."school_degree_type_id"
Should I create 4 indexes on each individual column (col1)(col2)(col3)(col4)
, or 1 index on all of the columns (col1, col2, col3, col4)
?