seniorSQL

What is index-only scan?

Updated May 17, 2026

Short answer

An index-only scan retrieves all required data directly from the index without accessing the table.

Deep explanation

In an index-only scan, the database satisfies a query entirely from the index structure. This works when all selected columns exist in the index and visibility checks confirm tuple validity (e.g., PostgreSQL visibility map). It significantly reduces I/O and improves performance.

Unlock with a Pro subscription to view this section.

View pricing

Real-world example

No real-world example available yet.

Unlock with a Pro subscription to view this section.

Upgrade to Pro

Common mistakes

No common mistakes listed yet.

Unlock with a Pro subscription to view this section.

Upgrade to Pro

Follow-up questions

No follow-up questions available yet.

Unlock with a Pro subscription to view this section.

Upgrade to Pro

More SQL interview questions

View all →