liveBook · Manning

Composite index

As explained in Crack Any Codebase with AI

A composite index is a database index built over multiple columns to support searches or ordering involving those columns.

A composite index combines two or more columns so the database can support a recurring query pattern. Read it as a fossilized record of what the application searches or sorts together, not merely as an optimization detail. section 7.6

Reading indexes as product behavior

A table may define indexes such as [startTime, endTime, status], [userId, status, startTime], and [eventTypeId, status]. The useful question is not only “what columns are indexed?” but “which product surface repeatedly needs these columns together?” Review each index as a clue to a common WHERE clause, then connect that clause to the user-facing behavior it makes fast. section 7.6

How Crack Any Codebase with AI covers it

How deep it goes
Explains their diagnostic meaning and product connection, but does not descend into database indexing internals or execution plans.
Examples
Uses Booking indexes combining startTime, endTime, status, userId, eventTypeId, and createdAt.
What it assumes
Assumes familiarity with tables, columns, schemas, and queries, while treating indexes as interpretable records of product decisions.
What you can do after
Evaluate schema decisions by mapping each composite index to the recurring product query or surface it supports.
How it connects
Connects composite indexes to schemas, tables, columns, product surfaces, and WHERE clauses.

Also explained in

Compare how 4 books explain composite index →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Crack Any Codebase with AI. The section links point to the parts of the book it draws on.