Expand my Community achievements bar.

Announcing the launch of new sub-community for Campaign Web UI to cater specifically to the needs of Campaign Web UI users!
SOLVED

How to find size of a schema (table) in Adobe Campaign Classic V7 in console

Avatar

Level 4

Hi Team,

 

I want to know how to find the size of a schema (table) in Adobe Campaign Classic v7 via Console. Please let us know if there is any possibility to find out the size directly in the Campaign Console instead of checking it in the Control Panel.

 

Thanks,

Raviteja Gundu

Topics

Topics help categorize Community content and increase your ability to discover relevant content.

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hello @ravitejagundu ,

i think there is no dashboard to show you table space. But if your user can run SQL commands you can create your own dashboard in email or webapp, with use of sqlSelect JSAPI function https://experienceleague.adobe.com/developer/campaign-api/api/f-sqlSelect.html

 

To find the size of a table in e.g. PostgreSQL db engine, you can use the following SQL query:

 

 

SELECT pg_size_pretty(pg_total_relation_size('your_table_name'));

 

 

 

Replace 'your_table_name' with the actual name of the table you want to find the size of.

This query will return the size of the table in a human-readable format, such as "23 MB" or "1 GB". The pg_total_relation_size function returns the total size of the table including all indexes and associated objects, and pg_size_pretty formats the size in a readable format.

 

In Adobe Campaign JS  you can do

 

 

var res = sqlSelect("table,@size:number",
        "SELECT pg_size_pretty(pg_total_relation_size('nmsGroup'))")
logInfo(res.table.@size)

 

 

 

>> 04/06/2023 4:55:16 AM js 160 kB

 

 

Marcel Szimonisz

MarTech Consultant
for more tips visit my blog
https://www.martechnotes.com/

View solution in original post

2 Replies

Avatar

Correct answer by
Community Advisor

Hello @ravitejagundu ,

i think there is no dashboard to show you table space. But if your user can run SQL commands you can create your own dashboard in email or webapp, with use of sqlSelect JSAPI function https://experienceleague.adobe.com/developer/campaign-api/api/f-sqlSelect.html

 

To find the size of a table in e.g. PostgreSQL db engine, you can use the following SQL query:

 

 

SELECT pg_size_pretty(pg_total_relation_size('your_table_name'));

 

 

 

Replace 'your_table_name' with the actual name of the table you want to find the size of.

This query will return the size of the table in a human-readable format, such as "23 MB" or "1 GB". The pg_total_relation_size function returns the total size of the table including all indexes and associated objects, and pg_size_pretty formats the size in a readable format.

 

In Adobe Campaign JS  you can do

 

 

var res = sqlSelect("table,@size:number",
        "SELECT pg_size_pretty(pg_total_relation_size('nmsGroup'))")
logInfo(res.table.@size)

 

 

 

>> 04/06/2023 4:55:16 AM js 160 kB

 

 

Marcel Szimonisz

MarTech Consultant
for more tips visit my blog
https://www.martechnotes.com/

Hi Marcel,

 

The sqlSelect command in JS worked perfectly. Now, I can able to see the size of the table now.

Appreciating your Swift response.

 

Thanks,

Raviteja Gundu.