
Depending on the nature of your workload, this can create contention of IOPS and introduce latencies, which can decrease performance. Additionally, when Amazon RDS uses Amazon EBS for temporary data processing, it also consumes your provisioned IOPS. One way to do this is to use an instance type with higher memory, but this may lead to overprovisioning for your overall workload. It’s important to optimize performance of queries that use the temporary work area, particularly for high concurrency workloads that heavily rely on it. What use cases can benefit from Optimized Reads? We also dive deep into analysis and comparison of performance results between Amazon EBS-only backed RDS instances and Optimized Reads RDS instances. In Part 2, we discuss why PostgreSQL uses temporary storage and when PostgreSQL performs operations on disk instead of in memory.
AMAZON RDS POSTGRES HOW TO
In this first post, we talk about use cases for Optimized Reads, how Amazon RDS enables local storage for the Optimized Reads feature, how to monitor the performance of local storage, when to consider migrating to an Optimized Reads instance, and the difference in performance of queries between RDS instances that use Amazon EBS and local storage. In this two-part series, we journey through how Amazon RDS for PostgreSQL improves performance of SQL operations with Optimized Reads. By choosing this new option during instance creation or by modifying the DB instance class of your existing RDS instance to the Optimized Reads instance class, Amazon RDS can automatically improve performance for the temporary work area by using local storage instead of Amazon Elastic Block Store (Amazon EBS) for database workloads. Optimized Reads uses the local storage provided by the NVMe SSDs on the underlying instances used in the Multi-AZ DB clusters. Today, we are introducing a new Amazon Relational Database Service (Amazon RDS) deployment option, Optimized Reads, with up to twice the read performance for workloads that heavily rely on a temporary work area. At times, depending on the volume of data, building this intermediate result set requires scanning through hundreds of millions of rows from multiple tables, which can be both time- and resource-consuming. After sending the top 10 expensive orders from the sorted intermediate result set to client, it is discarded. This sorting is called an intermediate result set.

For example, fetching the top 10 most expensive orders requires a pre-computed sort on the price value of each order in descending order. Intermediate results are a temporary dataset required by a SQL operation to compute the actual end result.


PostgreSQL uses a temporary work area for several operations, including to hold intermediate results to build indexes, and sort or group records for queries. For more information, refer to Multi-AZ DB cluster deployments.ĭatabase systems like PostgreSQL try to perform operations in memory for optimal performance, but there are situations where they must use a temporary work area on disk. These instances are equipped with fast NVMe SSDs for local storage, ideal for high speed and low-latency storage. The optimization of transaction latency uses local storage on purpose-built Amazon Elastic Compute Cloud (Amazon EC2) instances.

This deployment option increases read capacity with two readable standby instances, and improves write transaction latency and failover times. In March 2022, we introduced a new Multi-AZ deployment option for Amazon Relational Database Service (Amazon RDS) for PostgreSQL, called Multi-AZ DB clusters.
