I am seeing spike in cpu in RDS postgres 11 close to 95% when this "fetch forward" from a cursor was executing. Based on my findings this spike could be due to large amount of data transferred over network from server back to client application. Is there a way for me to troubleshoot this issue or any pointers will be helpful.
Following are the numbers from performance insights for this query - fetch forward
Aae: 498
Blk hits/sec: 249789
Blk reads/sec: 37.01
Temp writes/sec: 2222
Temp reads/sec: 1851.62
**avg latency(ms)/call: 3986
blk hits/call: 1996983**
tmp blk write/call: 17771
tmp blk read/call: 14803
Spike below contains mostly with CPU + WALWriteLock + DataFileRead + buffer_io
