def total_db_hits_profile(profile):
    """Compute the total number of db hits of a query profile."""
    nb = 0
    for child in profile.children:
        nb += total_db_hits_profile(child)
    nb += profile.db_hits
    return nb