How to Discuss Database Index Tuning in English
Learn the English vocabulary for discussing database index tuning: query plans, selectivity, and the trade-offs between read and write performance.
Proposing an index change well means explaining not just what you’re adding, but why the query planner will actually use it and what it costs on the write path — a proposal that only says “this will make queries faster” invites reasonable skepticism from anyone who’s seen an index made things worse.
Key Vocabulary
Query plan / execution plan — the database’s chosen strategy for running a specific query (a sequential scan, an index scan, a hash join), inspectable with EXPLAIN and the primary evidence for whether an index will actually help.
“The query plan shows a sequential scan across two million rows — that’s the smoking gun for why this query is slow, and exactly what the new index should eliminate.”
Selectivity — how effectively a column (or combination of columns) narrows down the result set; a highly selective column is a strong index candidate, while a low-selectivity one (like a boolean) often isn’t worth indexing alone.
“The status column has low selectivity — it’s one of three values across ten million rows, so indexing it alone won’t help much. Combining it with created_at in a composite index would.”
Composite index — an index spanning multiple columns, useful when queries consistently filter or sort on the same combination of fields, with column order mattering for which queries can actually use it.
“We need a composite index on (customer_id, created_at), in that order, since every query filters by customer first and then sorts by date.”
Write amplification (index overhead) — the added cost every insert, update, and delete incurs from maintaining an index, the trade-off side of adding one that has to be weighed against the read-side benefit. “This table gets heavy write traffic, so a new index isn’t free — every insert now has to update three indexes instead of two, and we should measure that write amplification before committing to it.”
Covering index — an index that includes all the columns a query needs, letting the database satisfy the query entirely from the index without touching the underlying table (an “index-only scan”).
“By including email in the index alongside the lookup key, this becomes a covering index for the login query — no need to hit the table at all.”
Common Phrases
- “What does the query plan show — a sequential scan, or is an existing index already being used inefficiently?”
- “Is this column selective enough to be worth indexing on its own?”
- “Should this be a composite index, and if so, what column order matches our actual query patterns?”
- “What’s the write amplification cost here, given how write-heavy this table is?”
- “Could we make this a covering index to avoid the extra table lookup entirely?”
Example Sentences
Proposing an index in a performance review:
“The query plan confirms a full sequential scan on this table for a query we run constantly. Adding a composite index on (user_id, status) should convert that to an index scan — I’ve tested it in staging and it cut the query time from 800ms to 12ms.”
Pushing back on an over-eager indexing proposal:
“Before we add this, let’s check selectivity — is_deleted is only true for a tiny fraction of rows, so an index on it alone probably won’t be used by the planner. A partial index might be the better fit.”
Explaining a trade-off to the team: “This index would help the read path significantly, but this table gets thousands of writes per second — the write amplification is a real cost. I’d want a benchmark before rolling it out to production.”
Professional Tips
- Always show the query plan, not just the observed latency, when proposing an index — “queries are slow” is unconvincing without the
EXPLAINoutput showing why. - Discuss selectivity before proposing an index on a low-cardinality column — it prevents both wasted indexing effort and the “why didn’t this help” follow-up conversation.
- State the intended column order explicitly when proposing a composite index — order determines which queries can actually use it, and getting it wrong makes the index dead weight.
- Name the write amplification cost alongside the read-side benefit in any indexing proposal — a one-sided pitch that ignores write cost is an easy target for a skeptical reviewer, and rightly so.
Practice Exercise
- Write a sentence explaining what a query plan reveals about index usage.
- Describe selectivity in your own words with a low-cardinality example.
- Explain the trade-off a composite index introduces on the write path.
Navigating Nuance: Specific Vocabulary for Index Tuning Discussions
Let’s be honest – talking about database indexes can quickly become a technical rabbit hole. Even experienced developers sometimes struggle to articulate precisely why an index is being suggested or what impact it will have. For non-native English speakers, the specialized vocabulary and subtle phrasing used in discussions around index tuning can feel particularly challenging. It’s not just about knowing the terms; it’s about understanding how those terms are used within a collaborative professional context.
One common scenario is during a code review. Imagine receiving this comment on a pull request: “This query could benefit from an index on customer_id.” A simple translation might be “the table needs to be faster.” But that misses the point entirely. Instead, a more effective response would be, “That’s a good suggestion. Could you elaborate on the selectivity of this query? Specifically, what percentage of rows does the customer_id column filter down to in this particular context?” Notice how using terms like “selectivity” immediately elevates the discussion beyond a basic statement about needing an index and forces the original author (or reviewer) to provide more detailed information. Similarly, you might hear someone say, “We need to optimize the orders table for reporting queries.” This could be improved by adding, “Let’s examine the query plan generated when running that query. Is it using an existing index effectively, or is it performing a full table scan? Understanding the query plan will help us determine if an index on order_date would provide a significant performance boost.”
Another situation arises in Slack conversations when discussing potential changes to a database schema. A developer might post: “Adding an index to product_name should speed things up.” Again, this is too vague. A better approach would be, “To ensure we’re making the right decision, let’s consider the trade-offs. While indexing product_name may improve read performance for queries filtering by product name, it could negatively impact write performance – specifically, inserting or updating rows in that column will require the index to be updated as well. Let’s also look at the overall read/write ratio of this table; is it predominantly read-heavy or write-heavy?” This demonstrates a more sophisticated understanding of the database system and highlights the importance of considering both aspects when proposing an index.
Finally, remember that clarity is key. Don’t be afraid to ask for clarification if you don’t understand something. Phrases like “Could you explain what you mean by ‘reducing scan time’?” or “Can you show me the query plan?” demonstrate a proactive approach and a willingness to learn – vital skills in any technical environment. Focusing on these specific vocabulary terms and phrasing patterns will significantly improve your ability to participate effectively in discussions about database index tuning and contribute meaningfully to your team’s success.