Databases · Middle · Question 7 of 75

Why might PostgreSQL choose a sequential scan even though an index exists?

Explanation

The planner estimates costs from statistics. For low-selectivity conditions (e.g. status = 'active' matching 90% of rows) a seq scan is the right choice.

Further reading

Problem with a question

Databases · Middle · question 7

Test yourself

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

Take this quiz