Bird
0
0

You want to speed up queries on a materialized view by adding an index on the customer_id column. Which statement is correct?

hard📝 Application Q9 of 15
PostgreSQL - Views and Materialized Views
You want to speed up queries on a materialized view by adding an index on the customer_id column. Which statement is correct?
AYou must create the index before creating the materialized view.
BIndexes cannot be created on materialized views.
CYou can create an index on a materialized view like a regular table.
DMaterialized views automatically create indexes on all columns.
Step-by-Step Solution
Solution:
  1. Step 1: Recall index support on materialized views

    Materialized views store data physically, so indexes can be created on them like tables.
  2. Step 2: Evaluate other options

    Indexes are not automatic, and must be created after the view exists.
  3. Final Answer:

    You can create an index on a materialized view like a regular table. -> Option C
  4. Quick Check:

    Materialized views support indexes like tables [OK]
Quick Trick: Create indexes on materialized views after creation for speed [OK]
Common Mistakes:
  • Thinking indexes are not allowed on materialized views
  • Trying to create indexes before view exists
  • Assuming automatic indexes on materialized views

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More PostgreSQL Quizzes