pgadmin4 icon indicating copy to clipboard operation
pgadmin4 copied to clipboard

Extension system_stats incorrect sorting of processes by ram usage

Open aa00aa11 opened this issue 2 months ago • 0 comments

Please note that security bugs or issues should be reported to [email protected].

Describe the bug

Extension system_stats incorrect sorting of processes by ram usage - sorting asc/desc doesnt account for units - kb, mb, gb and so on, i.e. 50 kb will be above 30 gb when sorting desc. Using windows 11, pgadmin 4 as standalone program.

To Reproduce

Steps to reproduce the behavior:

  1. enable system_stats extension;
  2. Go to dashboard -> system -> memory;
  3. Try sorting list of processes by clicking on column name "Memory bytes";

Expected behavior

List to be sorted by ram usage, accounting for both units and numerical values;

Error message

No error, but sorting is now "dumb" and raw and wrong, doesnt account for units, only applies sorting to final visible string of text, which is wrong in this type of sorting.

Screenshots

Image

As you can see, this is sorted in descending order. This needs custom sorting function, either comparing raw byte values, or parsing final text, setting fixed order for units, and only then looking at numerical values.

Desktop (please complete the following information):

  • OS: windows 11
  • pgAdmin version: 9.9 , but tried older versions too, still the same
  • Mode: desktop
  • Browser (if running in server mode): -
  • Package type: native windows installer

aa00aa11 avatar Nov 09 '25 09:11 aa00aa11