Postgresql – Does Postgres read blocks sequentially, even if a disk is high-latency

amazon-web-servicespostgresqlpostgresql-performance

I'm using Postgres on AWS EBS, when running a query that uses a bitmap heap scan and a bitmap index scan, the execution time seems proportional to the number of "heap blocks" read, as shown by the EXPLAIN ANALYZE (I've not 100% verified this). Because EBS is networked attached storage, it has a high (~1ms) latency, but a high throughput/bandwidth, meaning Postgres wouldn't be taking full advantage of the disk.

Is it the case that when reading from Disk postgres queries blocks/pages sequentially?

Best Answer

In the case of bitmap heap scan, it can issue async block reads. This is controlled by effective_io_concurrency.