How to get the table size in teradata?

Member

by gilbert , in category: MySQL , a month ago

How to get the table size in teradata?

Facebook Twitter LinkedIn Telegram Whatsapp

1 answer

by filiberto , a month ago

@gilbert 

In Teradata, you can get the size of a table by using the following SQL query:

1
SHOW TABLE <database_name>.<table_name>;


Replace <database_name> with the name of your database and <table_name> with the name of the table you want to get the size of. This query will return information about the table, including the total number of rows and the total size in bytes.


Alternatively, you can also use the following query to get the size of a table in Teradata:

1
2
3
4
5
6
7
SELECT
    SUM(currentperm) / 1024 / 1024 as Total_MB
FROM
    dbc.tablesize
WHERE
    databasename = '<database_name>'
    AND tablename = '<table_name>';


Replace <database_name> and <table_name> with the appropriate values. This query will return the total size of the table in megabytes.