diff options
| author | Taras Madan <tarasmadan@google.com> | 2026-01-05 17:36:51 +0100 |
|---|---|---|
| committer | Taras Madan <tarasmadan@google.com> | 2026-01-05 17:26:42 +0000 |
| commit | 15f6fd0844e8520755be8672db814ce14cad21da (patch) | |
| tree | de796640c71bbd4bd40535b1d7b6b2c4de8b1773 | |
| parent | 2a500d9eb91dd3ed6b53ef93a6b81d92ec494c2d (diff) | |
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.
| -rw-r--r-- | pkg/coveragedb/coveragedb.go | 20 |
1 files changed, 19 insertions, 1 deletions
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, }, |
