 	if(
 		ssvs.PROCESSING = 1,
 		"YES",
-		"NO") PROCESSING
+		"NO") IS_PROCESSING_NOW
 FROM stroom.SQL_STAT_VAL_SRC ssvs
 ORDER BY
     ssvs.NAME,
     ssvs.TIME_MS;
 
+-- SQL_STAT_VAL & SQL_STAT_KEY
 CREATE OR REPLACE VIEW v_stat_val AS
 SELECT
 	ssk.NAME,

    if(
        ssv.VAL_TP = 2,
        ssv.VAL / ssv.CT,
        null) STAT_VALUE_AGG
FROM SQL_STAT_KEY ssk
LEFT JOIN SQL_STAT_VAL ssv ON ssk.ID = ssv.FK_SQL_STAT_KEY_ID
ORDER BY


-- Some handy views for viewing the stats data, not used by the app

-- SQL_STAT_VAL_SRC
CREATE OR REPLACE VIEW v_stat_val_src AS
SELECT
	ssvs.NAME,
	FROM_UNIXTIME(ssvs.TIME_MS / 1000) TIME,
	ssvs.CT STAT_COUNT,
	ssvs.VAL STAT_VALUE_SUM,
    if(
        ssv.VAL_TP = 2,
        ssv.VAL / ssv.CT,
        null) STAT_VALUE_AVG
	if(
		ssvs.VAL_TP = 1,
		"COUNT",
