Courseiva

DA0-002 Data Concepts and Environments Practice Question

A DBA wants to improve query performance on a large table that is frequently filtered on two columns: department_id and hire_date. The table has millions of rows. Which index strategy would be most effective?

⚠ Common exam trap

Many candidates assume two separate single-column indexes are equivalent to a composite index, but they fail to realize that the database cannot efficiently combine them for range predicates without a costly index merge operation.

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 composite B-tree index on (department_id, hire_date)

A composite B-tree index on (department_id, hire_date) is most effective because it allows the database to satisfy equality and range predicates on both columns in a single index scan. B-tree indexes are optimized for high-cardinality columns and support efficient multi-column filtering when the leading column matches the query's equality condition, followed by the range condition on hire_date.

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 composite B-tree index on (department_id, hire_date)

    Why this is correct

    A composite B-tree index on (department_id, hire_date) lets the optimiser seek directly to a department and then range-scan hire_date within it, satisfying both filter predicates in one index. Separate single-column indexes would require bitmap merges or scans, which scale poorly across millions of rows.

  • ✗

    Create a bitmap index on hire_date

    Why it's wrong here

    A bitmap index on hire_date alone cannot serve the department_id predicate and bitmap indexes suit low-cardinality columns with read-heavy analytical workloads, not high-cardinality range filtering. It is the correct choice for data-warehouse queries on columns with few distinct values.

  • ✗

    Create a hash index on department_id only

    Why it's wrong here

    A hash index supports only equality predicates, so it cannot serve range filters on hire_date and cannot combine both columns in one lookup. Hash indexes are the correct choice for single-column equality probes on high-cardinality keys, not for multi-column range filtering.

  • ✗

    Create two separate B-tree indexes, one on each column

    Why it's wrong here

    Two separate single-column B-tree indexes force the optimiser to choose one and then filter the other column, or intersect row IDs, adding overhead on millions of rows. Separate indexes suit queries filtering on either column independently, not a combined department_id and hire_date predicate.

About these practice questions

One of 1,004 original DA0-002 practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

This DA0-002 practice question is part of Courseiva's free CompTIA 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 DA0-002 exam.