opened
aspedrosa
username_0
## Charts in use
- Types (Visit)

## Materialized view name

## Original Query
```sql
SELECT source.name, 
       concept_name AS "Observation", 
       count_value AS "Nr_Observations",
       source.slug
FROM public.achilles_results AS achilles
     INNER JOIN public.data_source AS source
     ON achilles.data_source_id=source.id
       INNER JOIN public.concept
       ON stratum_1 = CAST(concept_id AS text)
WHERE analysis_id = 201
```

## Optimized Query (If applicable)
Materialize the join between public.achilles_results, public.data_source and public.concept
```sql
SELECT name, 
       concept_name, -- AS "Observation",  -- do this transformation on superset
       count_value -- AS "Nr_Observations" -- do this transformation on superset
FROM already_joined_view
WHERE analysis_id = 201
```

## Remarks (If applicable)
Visit Types Query
issue
closed
aspedrosa
username_0
issue
created
aspedrosa
username_0
Solution took: materialize the entire query
comment