Rafia, Sergey, Many thanks for working on this!
> I have incorporated most of the suggestions into the patch. I have also > rebased and tested the patch on top of the current master I noticed that this patch is marked as "Needs Review" and decided to take a look. I believe there is a bug in the implementation. Here is what I did: ``` 57033 (master) =# select * from pg_stat_activity where pid = 57033; ... total_active_time | 9.128 total_idle_in_transaction_time | 0 57033 (master) =# select * from pg_stat_activity where pid = 57033; ... total_active_time | 10.626 total_idle_in_transaction_time | 0 57033 (master) =# BEGIN; 57033 (master) =# select * from pg_stat_activity where pid = 57033; ... total_active_time | 17.443 total_idle_in_transaction_time | 2314.703 57033 (master) =# select * from pg_stat_activity where pid = 57033; ... total_active_time | 2514.635 total_idle_in_transaction_time | 2314.703 57033 (master) =# COMMIT; 57033 (master) =# select * from pg_stat_activity where pid = 57033; ... total_active_time | 22.048 total_idle_in_transaction_time | 7300.911 ``` So it looks like total_active_time tracks seconds when a user executes single expressions and milliseconds when running a transaction. It should always track milliseconds. Please use `git format-patch` for the next patch and provide a commit message, as it was previously pointed out by Bharath. Please specify the list of the authors and reviewers and add a note about incrementing the catalog version. -- Best regards, Aleksander Alekseev