github.com/matrixorigin/matrixone@v1.2.0/test/distributed/cases/log/query_cu.sql (about) 1 set @stats="[3,7528422223,573384797164.000,0,1,247109,2]"; 2 set @duration=309319808921; 3 select json_extract(@stats, '$[1]') val; 4 select json_extract(@stats, '$[2]') val; 5 select json_extract(@stats, '$[3]') val; 6 select json_extract(@stats, '$[4]') val; 7 select json_extract(@stats, '$[5]') val; 8 select json_extract(@stats, '$[6]') val; 9 select CAST(mo_cu(@stats, @duration) AS DECIMAL(32,6)) as cu, CAST(mo_cu(@stats, @duration, "total") AS DECIMAL(32,6)) cu_total, CAST(mo_cu(@stats, @duration, "cpu") AS DECIMAL(32,6)) cu_cpu, CAST(mo_cu(@stats, @duration, "mem") AS DECIMAL(32,6)) cu_mem, CAST(mo_cu(@stats, @duration, "ioin") AS DECIMAL(32,6)) cu_ioin, CAST(mo_cu(@stats, @duration, "ioout") AS DECIMAL(32,6)) cu_ioout, CAST(mo_cu(@stats, @duration, "network") AS DECIMAL(32,6)) cu_network; 10 select CAST(JSON_UNQUOTE(JSON_EXTRACT(@stats, '$[1]')) * 3.45e-14 / 1.002678e-06 AS DECIMAL(32,6)) - CAST(mo_cu(@stats, @duration, "cpu") AS DECIMAL(32,6)) val; 11 select CAST(JSON_UNQUOTE(JSON_EXTRACT(@stats, '$[2]')) * 4.56e-24 * @duration / 1.002678e-06 AS DECIMAL(32,6)) - CAST(mo_cu(@stats, @duration, "mem") AS DECIMAL(32,6)) val; 12 select mo_cu('[1,1,2,3,4,5,0,0]', 0) val; 13 select mo_cu('[3,1,2,3,4,5,0,0]', 0) val;