Skip to content

Commit 15f6fd0

Browse files
committed
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.
1 parent 2a500d9 commit 15f6fd0

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

pkg/coveragedb/coveragedb.go

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -646,7 +646,25 @@ func RegenerateSubsystems(ctx context.Context, ns string, sss []*subsystem.Subsy
646646

647647
func getFilePaths(ctx context.Context, ns string, client spannerclient.SpannerClient) ([]string, error) {
648648
iter := client.Single().Query(ctx, spanner.Statement{
649-
SQL: `select filepath from file_subsystems where namespace=$1`,
649+
// Take file names from 1 quarterly, 1 monthly and 1 daily aggregations.
650+
SQL: `
651+
select
652+
distinct files.filepath
653+
from files
654+
where files.session in (
655+
select session from (
656+
select
657+
session
658+
from
659+
merge_history
660+
where
661+
namespace = $1
662+
order by dateto desc, duration desc
663+
limit 3
664+
) as sub
665+
)
666+
order by files.filepath
667+
`,
650668
Params: map[string]any{
651669
"p1": ns,
652670
},

0 commit comments

Comments
 (0)