Question

pc_data_workattach table and length(pzpvstream)

We are trying to work out how much data each application team is using on the pc_Data_Workattach table. We created the statement below, and would like to verify if the 'length(pzpvstream)' is in bits or bytes. Or is there some other calculation we should be using.

If we use bytes then 4456629939 would be 4.15 GIG. (4456629939/1024/1024/1024)

If we use bits then 4456629939 would be 0.518 GIG (4456629939/1024/1024/1024/8)

select substr(PXREFOBJECTKEY,1,locate(' ', PXREFOBJECTKEY)-1), sum(cast(length(pzpvstream) as bigint) ) from data.pc_data_workattach where locate(' ', PXREFOBJECTKEY) > 0 group by substr(PXREFOBJECTKEY,1,locate(' ', PXREFOBJECTKEY)-1)

14 record(s) selected.

1 2
---------------------------------- --------------------
XXX-CB-WLTHSV-WORK 4456629939
XXX-CB-ISC-WORK 2694371173
XXX-CB-INS-CI-WORK-GRP6 2255385034
PEGACPMFS-WORK-INTERACTION 243417062
XXX-CCR-WORK 193340746
XXX-CBR-WORK 74638277
XXX-FIN-IDCC-WORK 59038834
PEGACLMFS-WORK 2791664
PEGA-SCHEDULEDTASK 2431095
XXX-CB-ITRADEOB-WORK 1966272
XXX-FW-CIOFW-WORK 102572
PEGASOCIAL 79879
XXX-CB-INS-CI-WORK-INTERACTION 29692
XXX-FW-CIFW-WORK-GRP6 3910

Comments

Keep up to date on this post and subscribe to comments

March 21, 2019 - 6:39am

This column is defined as Bytes.

March 21, 2019 - 9:07am
Response to ARVINDMALAV

Our total allocation on the database for pc_data_workattach is only 4G, and then by your calculation there are at least another 5G more in other applications that are stored on this table.  How can this be? 

Tabschema    Tabname                                                 size in KB               size in MB                 size in GB

DATA PC_DATA_WORKATTACH 4335616 4234 4

March 22, 2019 - 9:39am

Whether the function call you are making to query a database column's length is in bytes or something else is a database question.  In most cases the length returned would be in bytes.