insert into metadata_statistics (order_sequence, metadata_defn, total_entries, rundate, metadata_id)
select rownumber() over (order by count(1) desc), 
'ViewsPerCatalog', count(1),
current timestamp, cvi_object_id
from cvi
where cvi_object_type = 'CTG'
group by cvi_object_id
;
commit;
