Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

This article explains how to get the size of a database table using find the memory consumed by the database tables using the SQL for Confluence app.

Instructions

  1. Login Log in to Confluence, navigate to the required page where you want to display the memory information.
  2. Edit the page, and, enter {sql or search for the SQL for Confluence macro.

    Info

    You must know the Data source profile name that can needs to be used to run queries given in the following instructions. 
    If you do not know which profile name
    can to be used, contact your Confluence Administrator before proceeding.


  3. Edit the macro and select the Data source profile.


  4. In the SQL statement field, provide the below query to display the disk space occupancy consumed by respective tables in MB.


    In the below example, jira_test1 is the database name and the query is tested on MySql DB.

    Code Block
    themeMidnight
    SELECT table_name AS 'Table', round(((data_length + index_length) / 1024 / 1024), 2) 'Size (MB)' FROM information_schema.TABLES WHERE table_schema = "jira_test1";				


  5. Click Save settings.

  6. Save your Confluence page and you can see the size of the table as shown:
Info

Refer to this link to know more about database source profiles in Confluence.