I'm using a foreign data wrapper to access mongodb and I'm looking for a way to monitor query stats against foreign tables.
It looks like the common methods have limited support for foreign tables at this time. pg_stat_statements collects the query, total time, and rows returned, which is useful. But all the disk access stats are zero (understandably). Looks like pg_stat_all_tables doesn't have any info on foreign tables from my tests.
I'm interested in the following:
- Foreign table rows read
- Foreign table bytes read
- Foreign table read time
I'm working with my own fork of the FDW, so I could build these in myself, but I was wondering if there's more generic support for this sort of stuff. Or at the least, if I do implement it can I push it into another stats collection framework rather than logging it.
Thanks,
David Crawford