pgcenter icon indicating copy to clipboard operation
pgcenter copied to clipboard

Problem with ordering by time columns

Open grayhemp opened this issue 6 years ago • 2 comments

First of all thanks very much for the tool - the best one in its niche!

I believe pgcenter v0.5.0 has a problem with ordering by time columns. Please note that in the example below when using descending ordering by t_all_t 791:04:45 goes after 79:18:40 which is wrong.

user       database   t_all_t      t_read_t   t_write_t   t_cpu_t      all_t     read_t   write_t   cpu_t     calls   queryid      query            
*****	   *****      96:58:35     00:02:00   00:00:00    96:56:34     0.00      0        0         0.00      0       5081e3f831   
*****	   *****      96:06:25     00:00:05   00:00:00    96:06:20     0.00      0        0         0.00      0       50e483e9ae   
*****	   *****      95:48:34     00:00:00   00:00:00    95:48:34     0.00      0        0         0.00      0       767b8a56f9   
*****	   *****      86:49:53     00:07:09   00:00:00    86:42:44     0.00      0        0         0.00      0       01d93a5541   
*****	   *****      82:54:56     00:04:13   00:00:00    82:50:42     0.00      0        0         0.00      0       36bc1dca66   
*****	   *****      82:25:43     00:03:37   00:00:00    82:22:06     0.00      0        0         0.00      0       868c464987   
*****	   *****      80:39:06     00:00:01   00:00:00    80:39:04     15.00     0        0         15.00     2       79d439f1fa   
*****	   *****      79:18:40     00:00:00   00:00:00    79:18:40     0.00      0        0         0.00      0       117b589937   
*****	   *****      791:04:45    02:42:08   00:00:00    788:22:37    52.00     0.50     0         51.50     46      c0ad1d000f   
*****	   *****      77:20:25     05:42:33   00:00:00    71:37:51     0.50      0.00     0         1.00      1       d8c30fc873   
*****	   *****      74:42:21     00:00:00   00:00:00    74:42:21     0.00      0        0         0.00      1       313c122eae   
*****	   *****      74:38:34     00:00:00   00:00:00    74:38:33     0.00      0        0         0.00      0       0c83c46b25   
*****	   *****      74:23:57     00:06:18   00:00:00    74:17:38     0.50      0        0         0.50      0       e8609f8be3   
*****	   *****      74:15:11     00:06:20   00:00:00    74:08:50     0.00      0        0         0.00      0       86eebe2b71   

Thanks in advance.

grayhemp avatar Nov 03 '18 19:11 grayhemp

Yes, I confirm this problem, it occur due to time columns are sorted as strings and from this point of view sorting is correct ))) but from user's point it looks wrong of course. As temp workaround, you can reset stats, since values are small and close to each others they will be sorted correctly.

lesovsky avatar Nov 06 '18 06:11 lesovsky

Yep, thanks for the advice.

grayhemp avatar Nov 06 '18 07:11 grayhemp