From 15f6fd0844e8520755be8672db814ce14cad21da Mon Sep 17 00:00:00 2001 From: Taras Madan Date: Mon, 5 Jan 2026 17:36:51 +0100 Subject: pkg/coveragedb: add subsystem information about the new files Current logic updates information about the already knows files. Additionally we want to see subsystem information about all the created/added files. --- pkg/coveragedb/coveragedb.go | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'pkg') diff --git a/pkg/coveragedb/coveragedb.go b/pkg/coveragedb/coveragedb.go index 7ae10047b..6afdb3087 100644 --- a/pkg/coveragedb/coveragedb.go +++ b/pkg/coveragedb/coveragedb.go @@ -646,7 +646,25 @@ func RegenerateSubsystems(ctx context.Context, ns string, sss []*subsystem.Subsy func getFilePaths(ctx context.Context, ns string, client spannerclient.SpannerClient) ([]string, error) { iter := client.Single().Query(ctx, spanner.Statement{ - SQL: `select filepath from file_subsystems where namespace=$1`, + // Take file names from 1 quarterly, 1 monthly and 1 daily aggregations. + SQL: ` +select + distinct files.filepath +from files +where files.session in ( + select session from ( + select + session + from + merge_history + where + namespace = $1 + order by dateto desc, duration desc + limit 3 + ) as sub +) +order by files.filepath +`, Params: map[string]any{ "p1": ns, }, -- cgit mrf-deployment