Skip to content

Views report#

Samples are exposed as a virtual base table named analytic. The query plugin id is analytic.

Views cannot emit a UNION, and MySQL and MariaDB have no FULL OUTER JOIN. The query plugin unions the monthly tables that exist, then turns each saved collector into a column:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
SELECT start, end, sequence,
  MAX(CASE WHEN plugin = :alpha THEN value END) AS alpha
FROM (
  SELECT plugin, value, start, end, sequence, timestamp
  FROM analytic_202610
  UNION ALL
  SELECT plugin, value, start, end, sequence, timestamp
  FROM analytic_202611
) analytic
GROUP BY start, end, sequence

GROUP BY is the portable form of joining the table to itself. A period that any collector recorded is kept. A collector with no row for that period is NULL.

Saved collectors stay fields after they are disabled, so an existing view keeps the column. Saving a collector clears the Views data cache. start and end are ISO dates, so a string filter of "starts with 2026-11" matches November. The period filter is labeled Day, Week, Month, and Year.

The optional view analytic_daily lists the period columns and filters to days. Add a collector field in the Views UI after you enable that collector. The view does not name an entity type.

Before any sample exists, the query reads an empty result instead of a missing table.