# What is a Selective SOQL Query, how does the Query Plan Tool work, and what are the indexing thresholds (30% of first 1M records, 15% after)?

**Topic:** Soql · **Difficulty:** Hard · **Asked at:** Salesforce, Amazon, Deloitte, Slalom · **Tags:** soql, performance, selectivity, indexes

Read it on the site: https://www.forcechallenges.com/interview-questions/what-is-a-selective-soql-query-how-does-the-query-plan-tool-work-and-what-are-the-indexing-thresholds-30-of

## Answer

A query is **selective** when its filter uses an indexed field and returns less than a threshold of the object's records, so the optimizer can use the index instead of a full table scan. Non-selective queries on large objects (over ~100,000 records) can fail in triggers with `Non-selective query against large object type`.

**Thresholds (standard index):** roughly 30% of the first 1 million records and 15% after, up to a cap (custom index: 10% / 5%).

Use the **Query Plan Tool** in the Developer Console: it shows cost per plan; a cost below 1 means selective (index is used).

---
Source: ForceChallenges · last updated 2026-10-21
