Databases · Middle · Question 1 of 75

What data structure does a default PostgreSQL index use?

Explanation

B-trees keep keys sorted, so they support equality, ranges (<, BETWEEN), sorting and prefix LIKE 'abc%' (with the right collation or operator class). Hash, GIN, GiST and BRIN are for special cases.

Further reading

Problem with a question

Databases · Middle · question 1

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