Proper support for I/O Timings on explain.depesz.com

Very long time ago (in PostgreSQL 9.2) we got ability to get, from EXPLAIN, information how long Pg spent on I/O operations. Reads and writes.

Over the years situation has changed.

Originally it looked like this:

I/O Timings: read=15.792 write=26.804

This told us that Pg spend 15.8ms reading from disk, and 26.8ms writing.

In Pg 15 there was a change that changed the output to something like:

I/O Timings: shared/local read=7856.010, temp read=17.070 write=27.042

This split timings information for shared/local buffers, and separately for temp buffers. If you're not clear on how are these different, I wrote about it previously.

This was fine, but now, for Pg17, we will get even more detailed information, like:

I/O Timings: shared write=23.77, local write=25.997, temp read=324

In here we have separately information about time to do I/O for shared pages, local ones, and temp. Of course each of them is split into read and write.

This is all fine and dandy, but unfortunately parsing of this information in explain.depesz.com left something to be desired. Basically, it was parsed, somehow, and shown, but the site didn't calculate, properly, IO speed for the operations.

Michael Paquier pinged me about the change of format which made me look closer into it. And now I can say that the problem is no more.

In one example I could easily find, you can see that write speed and total size of data is calculated, even using pg17+ timings format.

The weird part is that there is temp read timing, but no temp buffers read information, but I guess it was just artificially made explain by someone testing parser.

Took me some time to do it, but it works.

Thanks a lot Michael 🙂

If you're interested in the change, you can see it on GitLab.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.