Michel SALAIS De : David G. Johnston <david.g.johnston@xxxxxxxxx> On Wed, Jan 19, 2022 at 7:59 AM Ludwig Isaac Lim <ludz_lim@xxxxxxxxx> wrote:
Everything is done in memory, but the data has to get there first (hence BUFFERS as you figured out below).
The loops are ~= 400 and 6,000
Did you (can you even in RDS) attempt to clear those buffers? If the first query ran slowly because none of the data was in memory (which you don't know for certain because you didn't run with BUFFERS option then) then subsequent runs would indeed be faster (the implementation of shared buffers having fulfilled one of its major purposes in life). I'll agree buffers for that query does not seem to account for nearly two minutes...though as RDS is a shared resource I'd probably chalk at least some of it to contention on the underlying hardware (disk likely being more problematic than memory). David J. Hi, Another point to check is eventually IOPS… It depends on the contracted service, If the quantity of IOPS is guaranteed or not. When it is not guaranteed and a sufficiently heavy load (in I/O) was executed for a while, the value of IOPS falls down dramatically and then you are sure to have performance problems… Michel SALAIS |