display_table_stats.twig 3.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. <div id="tablestatistics">
  2. <fieldset>
  3. <legend>{% trans 'Information' %}</legend>
  4. {% if showtable['TABLE_COMMENT'] %}
  5. <p>
  6. <strong>{% trans 'Table comments:' %}</strong>
  7. {{ showtable['TABLE_COMMENT'] }}
  8. </p>
  9. {% endif %}
  10. <a id="showusage"></a>
  11. {% if not tbl_is_view and not db_is_system_schema %}
  12. <table id="tablespaceusage" class="width100 data">
  13. <caption class="tblHeaders">{% trans 'Space usage' %}</caption>
  14. <tbody>
  15. <tr>
  16. <th class="name">{% trans 'Data' %}</th>
  17. <td class="value">{{ data_size }}</td>
  18. <td class="unit">{{ data_unit }}</td>
  19. </tr>
  20. {% if index_size is defined %}
  21. <tr>
  22. <th class="name">{% trans 'Index' %}</th>
  23. <td class="value">{{ index_size }}</td>
  24. <td class="unit">{{ index_unit }}</td>
  25. </tr>
  26. {% endif %}
  27. {% if free_size is defined %}
  28. <tr>
  29. <th class="name">{% trans 'Overhead' %}</th>
  30. <td class="value">{{ free_size }}</td>
  31. <td class="unit">{{ free_unit }}</td>
  32. </tr>
  33. <tr>
  34. <th class="name">{% trans 'Effective' %}</th>
  35. <td class="value">{{ effect_size }}</td>
  36. <td class="unit">{{ effect_unit }}</td>
  37. </tr>
  38. {% endif %}
  39. {% if tot_size is defined and mergetable == false %}
  40. <tr>
  41. <th class="name">{% trans 'Total' %}</th>
  42. <td class="value">{{ tot_size }}</td>
  43. <td class="unit">{{ tot_unit }}</td>
  44. </tr>
  45. {% endif %}
  46. {# Optimize link if overhead #}
  47. {% if free_size is defined
  48. and (tbl_storage_engine == 'MYISAM'
  49. or tbl_storage_engine == 'ARIA'
  50. or tbl_storage_engine == 'MARIA'
  51. or tbl_storage_engine == 'BDB') %}
  52. <tr class="tblFooters print_ignore">
  53. <td colspan="3" class="center">
  54. <a href="sql.php" data-post="{{ url_query }}&amp;pos=0&amp;sql_query=
  55. {{- ('OPTIMIZE TABLE ' ~ Util_backquote(table))|url_encode }}">
  56. {{ Util_getIcon('b_tbloptimize', 'Optimize table'|trans) }}
  57. </a>
  58. </td>
  59. </tr>
  60. {% endif %}
  61. </tbody>
  62. </table>
  63. {% endif %}
  64. {% include 'table/structure/row_stats_table.twig' with {
  65. 'showtable': showtable,
  66. 'tbl_collation': tbl_collation,
  67. 'is_innodb': is_innodb,
  68. 'mergetable': mergetable,
  69. 'avg_size': avg_size is defined ? avg_size : null,
  70. 'avg_unit': avg_unit is defined ? avg_unit : null
  71. } only %}
  72. </fieldset>
  73. </div>