0PricingLogin
PostgreSQL Performance & Query Optimization · Lesson

Partial and Expression Indexes

Learn to create indexes on a subset of rows or on the result of an expression for targeted optimization.

Intro to Targeted Indexes

Welcome! In this lesson, we'll dive into two powerful, specialized index types in PostgreSQL: Partial Indexes and Expression Indexes.

These indexes allow for highly targeted optimization, focusing on specific subsets of data or the results of calculations, rather than entire columns.

Focus with Partial Indexes

A Partial Index is an index that covers only a portion of the rows in a table. You define this subset using a WHERE clause during index creation.

Think of it as filtering your index. Only rows that satisfy the WHERE condition will be included in the index structure.

All lessons in this course

  1. Hash, GIN, and GiST Indexes
  2. Partial and Expression Indexes
  3. Covering Indexes and Index-Only Scans
  4. BRIN Indexes for Large Sequential Data
← Back to PostgreSQL Performance & Query Optimization