liveBook · Manning

Functional index

A functional index is a database index whose entries are computed from a function or expression applied to table data.

How 2 Manning books explain it

Just Use Postgres!

A functional index is a database index whose entries are computed from a function or expression applied to one or more table columns.

How it is used
Optimizes frequent filters or ordering operations that compute values from one or more columns.
How deep it goes
Explains syntax, execution-plan changes, exact-expression matching, and over-indexing, without deeper index implementation details.
Examples
Demonstrates player performance margins and JSON pizza fields, comparing sequential scans with bitmap index scans.
What you can do after
Apply it via PostgreSQL CREATE INDEX and EXPLAIN to optimize matching computed-value queries and verify plan changes.

Read how Just Use Postgres! explains functional index →

PostgreSQL Mistakes and How to Avoid Them

An expression index is a database index whose indexed keys are computed from expressions over table data.

How it is used
Speeds recurring queries whose predicates apply a known function or transformation to stored values.
How deep it goes
Explains expression matching, query-plan consequences, workarounds, and function-or-cast limitations, but stops short of index implementation internals.
Examples
Uses timestamp truncation in payments and expression-based indexes on JSON keys as concrete cases.
What you can do after
Diagnose index usage with EXPLAIN and create predicates or expression indexes that match the indexed representation.

Read how PostgreSQL Mistakes and How to Avoid Them explains functional index →

Related concepts

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.