How to Find Netezza Table Size?

  • Post author:
  • Post last modified:February 27, 2018
  • Post category:Netezza
  • Reading time:3 mins read

There are two ways to identify the size of table in Netezza. One, query the Netezza system tables and get the table size. Second, use the Netezza admin tool to check table size. In this article, we will discuss on how to find Netezza table size using Netezza nzsql and Netezza admin tools.

More Readings:

How to Find Netezza Table Size?

When you create a table in Netezza using nzsql, the table does not consume any space on the data slices until you insert one or more rows into that table.

As you insert rows to the Netezza table, the Netezza system allocates a minimum of one extent, which is defined as 3 MB of storage space, on each data slice that stores a row of the table. Each extent is further divided into 24 128-KB block (pages). The system uses each 128-KB page (block) as needed to store the table rows. If all the 24 pages are exhausted then, system allocates another 3-MB extent to hold that data for the particular table on that data slice.

Find Netezza Table size using Netezza System Tables

You can use the below Netezza nzsql query to identify the table size:

Select used_bytes/pow(1024,3) as table_size_in_GB
from _v_table_storage_stat
where tablename = ‘your table’;

For example:

=>Select used_bytes/pow(1024,3) as table_size_in_GB
-> from _v_table_storage_stat
-> where tablename = ‘DIM_DATE’;

TABLE_SIZE_IN_GB
-------------------
0.1171875
(1 row)

Find Netezza Table size using Netezza Admin Tool

You can identify the table size using Netezza Admin tool:

Login to Netezza Admin tool->double click in database -> double click on table -> check table name and its corresponding used_bytes column for its size. Below is the screen shot on how it looks in Netezza admin:

How to Find Netezza Table Size

This Post Has 4 Comments

  1. Tom Brostek

    Should ‘user_bytes’ be ‘used_bytes’?

    1. Vithal Sampagar

      Hi,

      Corrected it.

  2. Siva

    Hi,
    How to check table occupied space on netezza by year wise..Please help me

    1. Vithal Sampagar

      Hi,

      _v_table_storage_stat table has only CREATEDATE column. I’m afraid you cannot provide date range to get table size.

Comments are closed.