Glossary · Database

Index

A database structure that speeds up data retrieval by creating an optimized lookup path for specific columns.

A database index is a data structure (typically a B-tree or hash table) that improves the speed of data retrieval operations on a table at the cost of additional storage space and slower writes. Indexes work similarly to a book index–instead of scanning every page (row) to find information, the database can look up the index to find the exact location. Types include single-column indexes, composite indexes (multiple columns), unique indexes, partial indexes (filtered subsets), and full-text indexes. Proper indexing is one of the most impactful database optimization techniques, potentially reducing query times from minutes to milliseconds.

In practice

How AI for Database applies it

AI for Database is index-aware–it generates queries that leverage your existing indexes and can suggest new indexes to improve performance.
Database · aifordatabase glossaryRead-only ✓

Fig — every answer ships with the tables, rows and SQL behind it.

See it on your own database

Connect read-only in minutes. Free models included.

Start free