Bird
0
0

Why does PostgreSQL use GiST indexes for geometric and text data instead of B-tree indexes?

hard📝 Conceptual Q10 of 15
PostgreSQL - Indexing Strategies
Why does PostgreSQL use GiST indexes for geometric and text data instead of B-tree indexes?
ABecause GiST supports complex data types and custom search strategies
BBecause B-tree indexes are slower for all data types
CBecause GiST indexes use less disk space than B-tree
DBecause B-tree indexes cannot be created on text columns
Step-by-Step Solution
Solution:
  1. Step 1: Understand index type capabilities

    GiST indexes allow indexing of complex data types like geometric shapes and text with custom search strategies like similarity and overlap.
  2. Step 2: Compare with B-tree indexes

    B-tree indexes are optimized for simple, ordered data types and equality or range queries, not complex spatial or text similarity searches.
  3. Final Answer:

    Because GiST supports complex data types and custom search strategies -> Option A
  4. Quick Check:

    GiST supports complex types and strategies, unlike B-tree [OK]
Quick Trick: GiST handles complex data and custom searches [OK]
Common Mistakes:
  • Thinking B-tree is always faster
  • Assuming GiST uses less space always
  • Believing B-tree cannot index text columns

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More PostgreSQL Quizzes