insert into metadata_statistics (order_sequence, metadata_defn, total_entries, rundate, metadata_id)
select rownumber() over(order by data_size desc), 
'DataSizePerItem', data_size, current timestamp, id
from (
select itd_item_id id,
length(itd_blob) as data_size
from itd
where  itd_company_id = 40001
and itd_next_version_id = 999999999
and itd_blob is not null
order by data_size desc
)as temp
;
commit;
