Question 502 of 1,730
Workload-Specific Database DesignmediumMultiple ChoiceObjective-mapped

Quick Answer

The correct action is to create a trigram index using the pg_trgm extension on the email column. A standard B-tree index cannot accelerate a LIKE query with a leading wildcard, such as `'%@example.com'`, because the database has no fixed prefix to begin a sorted scan. The pg_trgm extension solves this by breaking strings into three-character substrings (trigrams) and indexing them, enabling the query planner to match patterns efficiently even when the wildcard appears at the start. On the AWS Certified Database Specialty DBS-C01 exam, this scenario tests your understanding of PostgreSQL index types beyond B-tree, specifically for pattern-matching performance. A common trap is assuming a B-tree index will help any LIKE query, but remember: leading wildcards break B-tree scans. Memory tip: “Trigram for leading wildcard” — if the pattern starts with `%`, think trigram.

DBS-C01 Workload-Specific Database Design Practice Question

This DBS-C01 practice question tests your understanding of workload-specific database design. Read the scenario carefully and evaluate each option against the stated constraints before committing to an answer. After answering, compare your reasoning against the explanation and wrong-answer breakdown below. Once you have made your selection, read the full explanation to reinforce the concept and understand why each distractor is designed to mislead on exam day.

A company runs a customer relationship management (CRM) application on Amazon RDS for PostgreSQL. The application stores customer data in a table with over 50 million rows. The company recently added a new query that searches for customers by their email domain (e.g., '@example.com'). The query uses a LIKE pattern: 'WHERE email LIKE ''%@example.com'''. The query takes over 30 seconds to complete. The DBA has already created a B-tree index on the email column, but it does not help. Which action should the database specialist recommend to improve query performance?

Question 1mediummultiple choice
Read the full NAT/PAT explanation →

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

Create a trigram index (using pg_trgm extension) on the email column.

The query uses a leading wildcard LIKE pattern ('%@example.com'), which prevents a standard B-tree index from being used because the search string does not have a fixed prefix. A trigram index, provided by the pg_trgm extension, breaks strings into three-character substrings (trigrams) and allows the database to efficiently match patterns with leading wildcards. This index type is specifically designed for fuzzy text matching and LIKE queries with wildcards, reducing the query time from over 30 seconds to milliseconds.

Key principle: Answer the scenario, not the keyword: identify the specific constraint before choosing the most familiar-sounding option.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • Create a hash index on the email column.

    Why it's wrong here

    Hash indexes support only equality comparisons, not LIKE.

  • Increase the shared_buffers parameter to improve caching.

    Why it's wrong here

    Caching may help but does not address the lack of a suitable index for pattern matching.

  • Create a B-tree index on the reversed email string.

    Why it's wrong here

    B-tree indexes do not support leading wildcard LIKE queries efficiently.

  • Create a trigram index (using pg_trgm extension) on the email column.

    Why this is correct

    Trigram indexes are designed for fast LIKE queries.

    Related concept

    Read the scenario before looking for a memorised answer.

Common exam traps

Common exam trap: answer the scenario, not the keyword

The trap here is that candidates assume a B-tree index can handle all LIKE patterns, but AWS specifically tests the understanding that leading wildcards disable B-tree index scans, requiring a specialized index like pg_trgm for pattern-matching performance.

Detailed technical explanation

How to think about this question

The pg_trgm extension works by generating all trigrams from the indexed text and storing them in a GIN or GiST index; for a LIKE pattern with a leading wildcard, PostgreSQL can use the trigram index to find rows where the pattern's trigrams match, dramatically reducing the search space. Under the hood, the index stores trigrams as lexemes, and the query planner uses the similarity or containment operators to skip irrelevant rows. In real-world scenarios, trigram indexes are also effective for spelling correction, fuzzy matching, and full-text search alternatives when standard B-tree indexes fail.

KKey Concepts to Remember

  • Read the scenario before looking for a memorised answer.
  • Find the constraint that changes the correct option.
  • Eliminate answers that are true in general but not in this case.

TExam Day Tips

  • Watch for words such as best, first, most likely and least administrative effort.
  • Review why wrong options are wrong, not only why the correct option is correct.

Key takeaway

Answer the scenario, not the keyword: identify the specific constraint before choosing the most familiar-sounding option.

Real-world example

How this comes up in practice

A cloud solutions architect for a retail company is evaluating services for a new workload. The correct answer here reflects best practice for the specific scenario described — not a general cloud recommendation. Answer the scenario, not the keyword: identify the specific constraint before choosing the most familiar-sounding option. Cloud exam questions reward reading the constraint carefully: the same technology can be right or wrong depending on the use case.

What to study next

Got this wrong? Here's your next step.

Identify which exam domain this question belongs to, review the core concept, then practise similar questions from the same domain.

Related practice questions

Related DBS-C01 practice-question pages

Use these pages to review the topic behind this question. This is how one missed question becomes focused revision.

Practice this exam

Start a free DBS-C01 practice session

Short sessions build daily habit. Longer sessions build exam-day stamina. Try a timed session to simulate real conditions.

FAQ

Questions learners often ask

What does this DBS-C01 question test?

Workload-Specific Database Design — This question tests Workload-Specific Database Design — Read the scenario before looking for a memorised answer..

What is the correct answer to this question?

The correct answer is: Create a trigram index (using pg_trgm extension) on the email column. — The query uses a leading wildcard LIKE pattern ('%@example.com'), which prevents a standard B-tree index from being used because the search string does not have a fixed prefix. A trigram index, provided by the pg_trgm extension, breaks strings into three-character substrings (trigrams) and allows the database to efficiently match patterns with leading wildcards. This index type is specifically designed for fuzzy text matching and LIKE queries with wildcards, reducing the query time from over 30 seconds to milliseconds.

What should I do if I get this DBS-C01 question wrong?

Identify which exam domain this question belongs to, review the core concept, then practise similar questions from the same domain.

What is the key concept behind this question?

Read the scenario before looking for a memorised answer.

About these practice questions

Courseiva creates original exam-style practice questions with explanations and wrong-answer analysis. It does not publish real exam questions, exam dumps, or protected exam content. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

Last reviewed: Jun 24, 2026

Question Discussion

Share a tip, memory trick, or ask about the reasoning behind this question. Do not post real exam questions, leaked content, braindumps, or copyrighted exam material. Comments are moderated and may be removed without notice.

Loading comments…

Sign in to join the discussion.

This DBS-C01 practice question is part of Courseiva's free Amazon Web Services certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the DBS-C01 exam.