Skip to content

Week 11: Views and Indexes

Due: Wednesday, Nov 4th

Tuesday's class covers views and indexes; Thursday returns to querying from Python. GP4 asks your team to turn analytical queries into views, so this reading is directly useful.

Prompt

Paste the standard prompt, then paste this block.

Topic: Views and indexes.

My learning objectives:
- Explain what a view is, how a view differs from a table, and
  when a materialized view is worth the trouble.
- Describe what an index speeds up and what an index costs.
- Compare index types, and explain why a B-tree index is the
  usual default.

Show me where this lives in the documentation. Tell me what the
official docs call each thing and roughly where to find it, and
give me search terms, rather than explaining everything yourself.

Sources

Ask about the cost

Assistants describe what indexes speed up far more readily than what indexes cost. Ask directly: what does an index do to an INSERT, and when is adding one a bad idea? The PostgreSQL introduction answers both.