Databases · Junior · Question 73 of 75

Does PostgreSQL automatically create an index on a foreign key column like orders.user_id?

Explanation

Without an index, joins by user_id and deletes of users (which check for referencing orders) have to scan the whole orders table.

Further reading

Problem with a question

Databases · Junior · question 73

Test yourself

Take the Databases · Junior quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz