dalibo / pev2

Postgres Explain Visualizer 2
https://explain.dalibo.com
PostgreSQL License
2.58k stars 125 forks source link

New field for \d+ ou \di+ or \dt+ #485

Open Krysztophe opened 2 years ago

Krysztophe commented 2 years ago

One problem with pev2 is it's unable to obtain information from the database, especially about object sizes.

Is it possible to add a field, to put the output of \d+ and/or \di+` ?

It would be possible to compute the ratio of a table/index scanned by a node.

[14003](1343969)postgres@pgbench_100=# \d+
                                             Liste des relations
 Schéma ║       Nom        ║ Type  ║ Propriétaire ║  Persistence   ║ Méthode d'accès ║ Taille  ║ Description 
════════╬══════════════════╬═══════╬══════════════╬════════════════╬═════════════════╬═════════╬═════════════
 public ║ log              ║ table ║ postgres     ║ non journalisé ║ heap            ║ 40 kB   ║ 
 public ║ pg_buffercache   ║ vue   ║ postgres     ║ permanent      ║                 ║ 0 bytes ║ 
 public ║ pgbench_accounts ║ table ║ postgres     ║ permanent      ║ heap            ║ 1281 MB ║ 
 public ║ pgbench_branches ║ table ║ postgres     ║ permanent      ║ heap            ║ 40 kB   ║ 
 public ║ pgbench_history  ║ table ║ postgres     ║ permanent      ║ heap            ║ 5472 kB ║ 
 public ║ pgbench_tellers  ║ table ║ postgres     ║ permanent      ║ heap            ║ 80 kB   ║ 
[14003](1346821)postgres@pgbench_100=# \di+
                                                         Liste des relations
 Schéma ║            Nom             ║ Type  ║ Propriétaire ║      Table       ║ Persistence ║ Méthode d'accès ║ Taille ║ Description 
════════╬════════════════════════════╬═══════╬══════════════╬══════════════════╬═════════════╬═════════════════╬════════╬═════════════
 public ║ pgbench_accounts_btree_idx ║ index ║ postgres     ║ pgbench_accounts ║ permanent   ║ btree           ║ 66 MB  ║ 
 public ║ pgbench_accounts_gin_idx   ║ index ║ postgres     ║ pgbench_accounts ║ permanent   ║ gin             ║ 12 MB  ║ 
 public ║ pgbench_accounts_pkey      ║ index ║ postgres     ║ pgbench_accounts ║ permanent   ║ btree           ║ 214 MB ║ 
 public ║ pgbench_branches_pkey      ║ index ║ postgres     ║ pgbench_branches ║ permanent   ║ btree           ║ 16 kB  ║ 
 public ║ pgbench_tellers_pkey       ║ index ║ postgres     ║ pgbench_tellers  ║ permanent   ║ btree           ║ 40 kB  ║ 

Notes :

gleu commented 2 years ago

Not sure I'm in favor or not of this request. One thing for sure is that it shouldn't handle psql translation on table's name, and columns' name. English only.