Best approach for converting list of nested dictionaries to a single dictionary with aggregate functions
Try:

from collections import defaultdict
from datetime import date, datetime
from typing import DefaultDict, Set, List, Dict


DefaultSet = DefaultDict[date, Set[str]]


def default_set() -&gt; DefaultSet:
    return defaultdict(set)


aggregated: DefaultDict[str, DefaultSet] = defaultdict(default_set)

for entry in db_data:
    start_date: date = datetime.fromisoformat(entry['start_time']).date()
    result: Dict[str, List[str]] = entry['results']
    for k, v in result.items():
        aggregated[k][start_date].update(v)

grouped_data: Dict[str, Dict[date, int]] = {
    k: {gk: len(gv) for gk, gv in group.items()}
    for k, group in aggregated.items()
}


Notes:


I do not know if this is faster, but it's certainly simpler
If you're able, maintain the output with actual date keys
Your data are better-modeled by a defaultdict of defaultdicts of sets.
I used a bunch of type hints to make sure that I'm doing the right thing.