I have a postgresql select query that consumes only 12% CPU, and little to no memory, but it still takes about a minute to run.
I immediately tried to check the IO, using iotop. Sure enough, in iotop's "IO>" column my process was showing values in the 90-100 range.
A couple questions: Is this is a fractional percentage of all available IO? How is this calculated? My hard drive is a 7200RPM drive and the entire table is only 10 million rows. Is IO always limited by the read speed of the hard drive or can it be a different issue?
21 Answer
Look at this question: .
The IO column shows the percentage of the process time that is spent waiting on IO operations. So it is not related to a global usage of the disk.
You pointed out in the comments that your disk is reading at ~130 MB/s. I have a 5400 RPM HD here and I benchmarked my system partition using gnome-disks and could not get more than 100 MB/s when reading. So maybe your disk is not being able to handle all that load and that is why the query is slow.