A company is migrating an on-premises PostgreSQL database to Amazon RDS for PostgreSQL. The database has a large table that is frequently accessed by reporting queries. The reporting queries filter on a column that has a high cardinality but low selectivity. To optimize query performance on this table, which design choice should the database specialist recommend?
Trap 1: Partition the table by the filter column
Partitioning helps with large table management but doesn't optimize queries filtering on low-selectivity columns.
Trap 2: Use a read replica to offload reporting queries
Read replicas scale read traffic but do not optimize the performance of an individual query.
Trap 3: Increase the provisioned read IOPS for the RDS instance
Provisioned IOPS improves I/O performance but does not directly optimize query execution plans.
- A
Partition the table by the filter column
Why wrong: Partitioning helps with large table management but doesn't optimize queries filtering on low-selectivity columns.
- B
Use a read replica to offload reporting queries
Why wrong: Read replicas scale read traffic but do not optimize the performance of an individual query.
- C
Increase the provisioned read IOPS for the RDS instance
Why wrong: Provisioned IOPS improves I/O performance but does not directly optimize query execution plans.
- D
Create a covering index on the filter column
A covering index includes all columns needed, allowing query results to be returned from the index alone.