May 2018
Intermediate to advanced
576 pages
30h 25m
English
If not enough of the data fits in shared buffers, lots of rereading of the same data happens, causing performance issues. In pg_statio_user_tables, watch the heap_blks_hit and heap_blks_read fields, or the equivalent ones for index and toast relations. They give you a fairly good idea of how much of your data is found in PostgreSQL's shared buffers (heap_blks_hit) and how much had to be fetched from the disk (heap_blks_read). If you see large numbers of blocks being read from the disk continuously, you may want to tune those queries; or if you determine that the disk reads were justified, you can make the configured shared_buffers value bigger.
If your shared_buffers parameter is tuned properly and you can't rewrite the query ...