[2026-09-22 07:05:05] local.DEBUG: EstimationN1QueryBuilder {"context":"App\\Services\\Inventaire\\{closure}","mode":"fact","source_table":"observatoire.fact_estimation_n_1","filter_level":"epci","display_level":null,"years":[2025],"sql":"select fe1.year_id, COALESCE(t.name, '(non rattaché)') AS territoire, COALESCE(a.name, '(non rattaché)') AS activite, ROUND(SUM(fe1.so2_kg_n1)::numeric, 4) AS so2_kg_n1, ROUND(SUM(fe1.nox_kg_n1)::numeric, 4) AS nox_kg_n1, ROUND(SUM(fe1.pm10_kg_n1)::numeric, 4) AS pm10_kg_n1, ROUND(SUM(fe1.pm2_5_kg_n1)::numeric, 4) AS pm2_5_kg_n1, ROUND(SUM(fe1.nh3_kg_n1)::numeric, 4) AS nh3_kg_n1, ROUND(SUM(fe1.covnm_kg_n1)::numeric, 4) AS covnm_kg_n1 from \"observatoire\".\"fact_estimation_n_1\" as \"fe1\" left join \"observatoire\".\"dim_territories\" as \"t\" on \"t\".\"id\" = \"fe1\".\"geo_id\" inner join \"observatoire\".\"dim_activities\" as \"a\" on \"a\".\"id\" = \"fe1\".\"activity_pcaet_id\" where \"fe1\".\"year_id\" in (2025) and \"fe1\".\"geo_id\" in (-2074645457) and \"fe1\".\"activity_pcaet_id\" in (-622080275, 208862058, 74904297, 1926750763, 1705942411, -273970232, -1732845089, 14022040) and \"fe1\".\"activity_secten_id\" not in (633536125, 1705364151) group by \"fe1\".\"year_id\", \"territoire\", \"activite\""} 
[2026-09-22 07:05:05] local.DEBUG: EstimationN1QueryBuilder {"context":"App\\Services\\Inventaire\\{closure}","mode":"fact","source_table":"observatoire.fact_estimation_n_1","filter_level":"epci","display_level":null,"years":[2025],"sql":"select fe1.year_id, COALESCE(t.name, '(non rattaché)') AS territoire, COALESCE(a.name, '(non rattaché)') AS activite, ROUND(SUM(fe1.so2_kg_n1)::numeric, 4) AS so2_kg_n1, ROUND(SUM(fe1.nox_kg_n1)::numeric, 4) AS nox_kg_n1, ROUND(SUM(fe1.pm10_kg_n1)::numeric, 4) AS pm10_kg_n1, ROUND(SUM(fe1.pm2_5_kg_n1)::numeric, 4) AS pm2_5_kg_n1, ROUND(SUM(fe1.nh3_kg_n1)::numeric, 4) AS nh3_kg_n1, ROUND(SUM(fe1.covnm_kg_n1)::numeric, 4) AS covnm_kg_n1 from \"observatoire\".\"fact_estimation_n_1\" as \"fe1\" left join \"observatoire\".\"dim_territories\" as \"t\" on \"t\".\"id\" = \"fe1\".\"geo_id\" inner join \"observatoire\".\"dim_activities\" as \"a\" on \"a\".\"id\" = \"fe1\".\"activity_pcaet_id\" where \"fe1\".\"year_id\" in (2025) and \"fe1\".\"geo_id\" in (-2074645457) and \"fe1\".\"activity_pcaet_id\" in (-622080275, 208862058, 74904297, 1926750763, 1705942411, -273970232, -1732845089, 14022040) and \"fe1\".\"activity_secten_id\" not in (633536125, 1705364151) group by \"fe1\".\"year_id\", \"territoire\", \"activite\""} 
[2026-09-22 07:05:08] local.DEBUG: EstimationN1QueryBuilder {"context":"App\\Services\\Inventaire\\{closure}","mode":"fact","source_table":"observatoire.fact_estimation_n_1","filter_level":"epci","display_level":null,"years":[2025],"sql":"select fe1.year_id, COALESCE(t.name, '(non rattaché)') AS territoire, COALESCE(a.name, '(non rattaché)') AS activite, ROUND(SUM(fe1.so2_kg_n1)::numeric, 4) AS so2_kg_n1, ROUND(SUM(fe1.nox_kg_n1)::numeric, 4) AS nox_kg_n1, ROUND(SUM(fe1.pm10_kg_n1)::numeric, 4) AS pm10_kg_n1, ROUND(SUM(fe1.pm2_5_kg_n1)::numeric, 4) AS pm2_5_kg_n1, ROUND(SUM(fe1.nh3_kg_n1)::numeric, 4) AS nh3_kg_n1, ROUND(SUM(fe1.covnm_kg_n1)::numeric, 4) AS covnm_kg_n1 from \"observatoire\".\"fact_estimation_n_1\" as \"fe1\" left join \"observatoire\".\"dim_territories\" as \"t\" on \"t\".\"id\" = \"fe1\".\"geo_id\" inner join \"observatoire\".\"dim_activities\" as \"a\" on \"a\".\"id\" = \"fe1\".\"activity_pcaet_id\" where \"fe1\".\"year_id\" in (2025) and \"fe1\".\"geo_id\" in (-2074645457) and \"fe1\".\"activity_pcaet_id\" in (-622080275, 208862058, 74904297, 1926750763, 1705942411, -273970232, -1732845089, 14022040) and \"fe1\".\"activity_secten_id\" not in (633536125, 1705364151) group by \"fe1\".\"year_id\", \"territoire\", \"activite\""} 
[2026-09-22 07:44:25] local.DEBUG: ProductionQueryBuilder {"context":"App\\Services\\Inventaire\\{closure}","mode":"fact","source_table":"observatoire.fact_production","filter_level":"epci","display_level":null,"years":[2024],"sql":"select fp.year_id, COALESCE(t.name, '(non rattaché)') AS territoire, ROUND(SUM(fp.prod_gwh)::numeric, 4) AS prod_gwh from (select DISTINCT territory_id from \"observatoire\".\"dim_territory_memberships\" where \"parent_id\" in (976323895)) as communes inner join \"observatoire\".\"fact_production\" as \"fp\" on \"fp\".\"geo_id\" = \"communes\".\"territory_id\" and \"fp\".\"year_id\" in (2024) left join \"observatoire\".\"dim_territory_memberships\" as \"dtm_d\" on \"dtm_d\".\"territory_id\" = \"fp\".\"geo_id\" and \"dtm_d\".\"parent_id\" in (976323895) left join \"observatoire\".\"dim_territories\" as \"t\" on \"t\".\"id\" = \"dtm_d\".\"parent_id\" where \"fp\".\"filiere_id\" not in (-1193645855, -1543929019, -2102167500, -1589048475, 1413501954, -1316980943, 801089390, 193523191, 1500531356, 967948000, 1033820579, -1392130500, 1716416743, -1109286771, 1942610929, 2138005553, 1680724918, -1240650519, 1218982353, 2023042180, 829965003, -243069253) group by \"fp\".\"year_id\", \"territoire\""} 
[2026-09-22 07:44:25] local.DEBUG: ProductionQueryBuilder {"context":"App\\Services\\Inventaire\\{closure}","mode":"fact","source_table":"observatoire.fact_production","filter_level":"epci","display_level":null,"years":[2024],"sql":"select fp.year_id, COALESCE(t.name, '(non rattaché)') AS territoire, ROUND(SUM(fp.prod_gwh)::numeric, 4) AS prod_gwh from (select DISTINCT territory_id from \"observatoire\".\"dim_territory_memberships\" where \"parent_id\" in (976323895)) as communes inner join \"observatoire\".\"fact_production\" as \"fp\" on \"fp\".\"geo_id\" = \"communes\".\"territory_id\" and \"fp\".\"year_id\" in (2024) left join \"observatoire\".\"dim_territory_memberships\" as \"dtm_d\" on \"dtm_d\".\"territory_id\" = \"fp\".\"geo_id\" and \"dtm_d\".\"parent_id\" in (976323895) left join \"observatoire\".\"dim_territories\" as \"t\" on \"t\".\"id\" = \"dtm_d\".\"parent_id\" where \"fp\".\"filiere_id\" not in (-1193645855, -1543929019, -2102167500, -1589048475, 1413501954, -1316980943, 801089390, 193523191, 1500531356, 967948000, 1033820579, -1392130500, 1716416743, -1109286771, 1942610929, 2138005553, 1680724918, -1240650519, 1218982353, 2023042180, 829965003, -243069253) group by \"fp\".\"year_id\", \"territoire\""} 
[2026-09-22 08:45:50] local.DEBUG: ProductionQueryBuilder {"context":"App\\Services\\Inventaire\\{closure}","mode":"fact","source_table":"observatoire.fact_production","filter_level":"epci","display_level":"cea","years":[2024,2017],"sql":"select fp.year_id, COALESCE(t_parent.name, '(non rattaché)') AS territoire_parent, COALESCE(t.name, '(non rattaché)') AS territoire, v.name AS vecteur, ROUND(SUM(fp.prod_gwh)::numeric, 4) AS prod_gwh from (select DISTINCT territory_id from \"observatoire\".\"dim_territory_memberships\" where \"parent_id\" in (96936853)) as communes inner join \"observatoire\".\"fact_production\" as \"fp\" on \"fp\".\"geo_id\" = \"communes\".\"territory_id\" and \"fp\".\"year_id\" in (2024, 2017) left join \"observatoire\".\"dim_territory_memberships\" as \"dtm_d\" on \"dtm_d\".\"territory_id\" = \"fp\".\"geo_id\" and 0 = 1 left join \"observatoire\".\"dim_territories\" as \"t\" on \"t\".\"id\" = \"dtm_d\".\"parent_id\" left join \"observatoire\".\"dim_territory_memberships\" as \"dtm_parent\" on \"dtm_parent\".\"territory_id\" = \"fp\".\"geo_id\" and \"dtm_parent\".\"parent_id\" in (96936853) left join \"observatoire\".\"dim_territories\" as \"t_parent\" on \"t_parent\".\"id\" = \"dtm_parent\".\"parent_id\" inner join \"observatoire\".\"dim_vecteurs\" as \"v\" on \"v\".\"id\" = \"fp\".\"vecteur_id\" where \"fp\".\"vecteur_id\" in (2) and \"fp\".\"filiere_id\" not in (-1193645855, -1543929019, -2102167500, -1589048475, 1413501954, -1316980943, 801089390, 193523191, 1500531356, 967948000, 1033820579, -1392130500, 1716416743, -1109286771, 1942610929, 2138005553, 1680724918, -1240650519, 1218982353, 2023042180, 829965003, -243069253) group by \"fp\".\"year_id\", \"territoire_parent\", \"territoire\", \"v\".\"name\""} 
[2026-09-22 08:45:50] local.DEBUG: ProductionQueryBuilder {"context":"App\\Services\\Inventaire\\{closure}","mode":"fact","source_table":"observatoire.fact_production","filter_level":"epci","display_level":"cea","years":[2024,2017],"sql":"select fp.year_id, COALESCE(t_parent.name, '(non rattaché)') AS territoire_parent, COALESCE(t.name, '(non rattaché)') AS territoire, v.name AS vecteur, ROUND(SUM(fp.prod_gwh)::numeric, 4) AS prod_gwh from (select DISTINCT territory_id from \"observatoire\".\"dim_territory_memberships\" where \"parent_id\" in (96936853)) as communes inner join \"observatoire\".\"fact_production\" as \"fp\" on \"fp\".\"geo_id\" = \"communes\".\"territory_id\" and \"fp\".\"year_id\" in (2024, 2017) left join \"observatoire\".\"dim_territory_memberships\" as \"dtm_d\" on \"dtm_d\".\"territory_id\" = \"fp\".\"geo_id\" and 0 = 1 left join \"observatoire\".\"dim_territories\" as \"t\" on \"t\".\"id\" = \"dtm_d\".\"parent_id\" left join \"observatoire\".\"dim_territory_memberships\" as \"dtm_parent\" on \"dtm_parent\".\"territory_id\" = \"fp\".\"geo_id\" and \"dtm_parent\".\"parent_id\" in (96936853) left join \"observatoire\".\"dim_territories\" as \"t_parent\" on \"t_parent\".\"id\" = \"dtm_parent\".\"parent_id\" inner join \"observatoire\".\"dim_vecteurs\" as \"v\" on \"v\".\"id\" = \"fp\".\"vecteur_id\" where \"fp\".\"vecteur_id\" in (2) and \"fp\".\"filiere_id\" not in (-1193645855, -1543929019, -2102167500, -1589048475, 1413501954, -1316980943, 801089390, 193523191, 1500531356, 967948000, 1033820579, -1392130500, 1716416743, -1109286771, 1942610929, 2138005553, 1680724918, -1240650519, 1218982353, 2023042180, 829965003, -243069253) group by \"fp\".\"year_id\", \"territoire_parent\", \"territoire\", \"v\".\"name\""} 
[2026-09-22 10:30:48] local.DEBUG: ProductionQueryBuilder {"context":"App\\Services\\Inventaire\\{closure}","mode":"fact","source_table":"observatoire.fact_production","filter_level":"epci","display_level":null,"years":[2024,2023],"sql":"select fp.year_id, COALESCE(t.name, '(non rattaché)') AS territoire, COALESCE(fi.name, '(non rattaché)') AS filiere, ROUND(SUM(fp.prod_gwh)::numeric, 4) AS prod_gwh from (select DISTINCT territory_id from \"observatoire\".\"dim_territory_memberships\" where \"parent_id\" in (-2074645457)) as communes inner join \"observatoire\".\"fact_production\" as \"fp\" on \"fp\".\"geo_id\" = \"communes\".\"territory_id\" and \"fp\".\"year_id\" in (2024, 2023) left join \"observatoire\".\"dim_territory_memberships\" as \"dtm_d\" on \"dtm_d\".\"territory_id\" = \"fp\".\"geo_id\" and \"dtm_d\".\"parent_id\" in (-2074645457) left join \"observatoire\".\"dim_territories\" as \"t\" on \"t\".\"id\" = \"dtm_d\".\"parent_id\" inner join \"observatoire\".\"dim_filiere_memberships\" as \"dtm_fi\" on \"dtm_fi\".\"filiere_id\" = \"fp\".\"filiere_id\" and \"dtm_fi\".\"parent_id\" in (732180862, 1824193386, 2065315848, -1014473487, -1083934513) inner join \"observatoire\".\"dim_filieres\" as \"fi\" on \"fi\".\"id\" = \"dtm_fi\".\"parent_id\" where \"fp\".\"filiere_id\" in (-1844241335, -992312423, -929314708, -318804108, 1371856852, 1489167039, 1498175839, 1723321957, 1961061561) and \"fp\".\"filiere_id\" not in (-1193645855, -1543929019, -2102167500, -1589048475, 1413501954, -1316980943, 801089390, 193523191, 1500531356, 967948000, 1033820579, -1392130500, 1716416743, -1109286771, 1942610929, 2138005553, 1680724918, -1240650519, 1218982353, 2023042180, 829965003, -243069253) group by \"fp\".\"year_id\", \"territoire\", \"filiere\""} 
[2026-09-22 10:30:48] local.DEBUG: ProductionQueryBuilder {"context":"App\\Services\\Inventaire\\{closure}","mode":"fact","source_table":"observatoire.fact_production","filter_level":"epci","display_level":null,"years":[2024,2023],"sql":"select fp.year_id, COALESCE(t.name, '(non rattaché)') AS territoire, COALESCE(fi.name, '(non rattaché)') AS filiere, ROUND(SUM(fp.prod_gwh)::numeric, 4) AS prod_gwh from (select DISTINCT territory_id from \"observatoire\".\"dim_territory_memberships\" where \"parent_id\" in (-2074645457)) as communes inner join \"observatoire\".\"fact_production\" as \"fp\" on \"fp\".\"geo_id\" = \"communes\".\"territory_id\" and \"fp\".\"year_id\" in (2024, 2023) left join \"observatoire\".\"dim_territory_memberships\" as \"dtm_d\" on \"dtm_d\".\"territory_id\" = \"fp\".\"geo_id\" and \"dtm_d\".\"parent_id\" in (-2074645457) left join \"observatoire\".\"dim_territories\" as \"t\" on \"t\".\"id\" = \"dtm_d\".\"parent_id\" inner join \"observatoire\".\"dim_filiere_memberships\" as \"dtm_fi\" on \"dtm_fi\".\"filiere_id\" = \"fp\".\"filiere_id\" and \"dtm_fi\".\"parent_id\" in (732180862, 1824193386, 2065315848, -1014473487, -1083934513) inner join \"observatoire\".\"dim_filieres\" as \"fi\" on \"fi\".\"id\" = \"dtm_fi\".\"parent_id\" where \"fp\".\"filiere_id\" in (-1844241335, -992312423, -929314708, -318804108, 1371856852, 1489167039, 1498175839, 1723321957, 1961061561) and \"fp\".\"filiere_id\" not in (-1193645855, -1543929019, -2102167500, -1589048475, 1413501954, -1316980943, 801089390, 193523191, 1500531356, 967948000, 1033820579, -1392130500, 1716416743, -1109286771, 1942610929, 2138005553, 1680724918, -1240650519, 1218982353, 2023042180, 829965003, -243069253) group by \"fp\".\"year_id\", \"territoire\", \"filiere\""} 
[2026-09-22 10:30:52] local.DEBUG: ProductionQueryBuilder {"context":"App\\Services\\Inventaire\\{closure}","mode":"fact","source_table":"observatoire.fact_production","filter_level":"epci","display_level":null,"years":[2024,2023],"sql":"select fp.year_id, COALESCE(t.name, '(non rattaché)') AS territoire, COALESCE(fi.name, '(non rattaché)') AS filiere, ROUND(SUM(fp.prod_gwh)::numeric, 4) AS prod_gwh from (select DISTINCT territory_id from \"observatoire\".\"dim_territory_memberships\" where \"parent_id\" in (-2074645457)) as communes inner join \"observatoire\".\"fact_production\" as \"fp\" on \"fp\".\"geo_id\" = \"communes\".\"territory_id\" and \"fp\".\"year_id\" in (2024, 2023) left join \"observatoire\".\"dim_territory_memberships\" as \"dtm_d\" on \"dtm_d\".\"territory_id\" = \"fp\".\"geo_id\" and \"dtm_d\".\"parent_id\" in (-2074645457) left join \"observatoire\".\"dim_territories\" as \"t\" on \"t\".\"id\" = \"dtm_d\".\"parent_id\" inner join \"observatoire\".\"dim_filiere_memberships\" as \"dtm_fi\" on \"dtm_fi\".\"filiere_id\" = \"fp\".\"filiere_id\" and \"dtm_fi\".\"parent_id\" in (732180862, 1824193386, 2065315848, -1014473487, -1083934513) inner join \"observatoire\".\"dim_filieres\" as \"fi\" on \"fi\".\"id\" = \"dtm_fi\".\"parent_id\" where \"fp\".\"filiere_id\" in (-1844241335, -992312423, -929314708, -318804108, 1371856852, 1489167039, 1498175839, 1723321957, 1961061561) and \"fp\".\"filiere_id\" not in (-1193645855, -1543929019, -2102167500, -1589048475, 1413501954, -1316980943, 801089390, 193523191, 1500531356, 967948000, 1033820579, -1392130500, 1716416743, -1109286771, 1942610929, 2138005553, 1680724918, -1240650519, 1218982353, 2023042180, 829965003, -243069253) group by \"fp\".\"year_id\", \"territoire\", \"filiere\""} 
[2026-09-22 10:30:54] local.DEBUG: ProductionQueryBuilder {"context":"App\\Services\\Inventaire\\{closure}","mode":"fact","source_table":"observatoire.fact_production","filter_level":"epci","display_level":null,"years":[2024,2023],"sql":"select fp.year_id, COALESCE(t.name, '(non rattaché)') AS territoire, COALESCE(fi.name, '(non rattaché)') AS filiere, ROUND(SUM(fp.prod_gwh)::numeric, 4) AS prod_gwh from (select DISTINCT territory_id from \"observatoire\".\"dim_territory_memberships\" where \"parent_id\" in (-2074645457)) as communes inner join \"observatoire\".\"fact_production\" as \"fp\" on \"fp\".\"geo_id\" = \"communes\".\"territory_id\" and \"fp\".\"year_id\" in (2024, 2023) left join \"observatoire\".\"dim_territory_memberships\" as \"dtm_d\" on \"dtm_d\".\"territory_id\" = \"fp\".\"geo_id\" and \"dtm_d\".\"parent_id\" in (-2074645457) left join \"observatoire\".\"dim_territories\" as \"t\" on \"t\".\"id\" = \"dtm_d\".\"parent_id\" inner join \"observatoire\".\"dim_filiere_memberships\" as \"dtm_fi\" on \"dtm_fi\".\"filiere_id\" = \"fp\".\"filiere_id\" and \"dtm_fi\".\"parent_id\" in (732180862, 1824193386, 2065315848, -1014473487, -1083934513) inner join \"observatoire\".\"dim_filieres\" as \"fi\" on \"fi\".\"id\" = \"dtm_fi\".\"parent_id\" where \"fp\".\"filiere_id\" in (-1844241335, -992312423, -929314708, -318804108, 1371856852, 1489167039, 1498175839, 1723321957, 1961061561) and \"fp\".\"filiere_id\" not in (-1193645855, -1543929019, -2102167500, -1589048475, 1413501954, -1316980943, 801089390, 193523191, 1500531356, 967948000, 1033820579, -1392130500, 1716416743, -1109286771, 1942610929, 2138005553, 1680724918, -1240650519, 1218982353, 2023042180, 829965003, -243069253) group by \"fp\".\"year_id\", \"territoire\", \"filiere\""} 
[2026-09-22 13:46:31] local.DEBUG: EmissionQueryBuilder {"context":"App\\Services\\Inventaire\\{closure}","mode":"agg","source_table":"observatoire.agg_petr","filter_level":"petr","display_level":null,"years":[2024],"sql":"select em.year_id, COALESCE(t.name, '(non rattaché)') AS territoire, ROUND((SUM(em.conso_ener_finale_clim_normal_gj)/3.6)::numeric, 2) AS conso_ener_finale_clim_normal_gj, ROUND((SUM(em.conso_ener_finale_clim_reel_gj)/3.6)::numeric, 2) AS conso_ener_finale_clim_reel_gj from \"observatoire\".\"agg_petr\" as \"em\" left join \"observatoire\".\"dim_territories\" as \"t\" on \"t\".\"id\" = \"em\".\"geo_id\" where \"em\".\"year_id\" in (2024) and \"em\".\"geo_id\" in (-1339322508) and \"em\".\"activity_id\" not in (-1961301967, 1409433884, -480772070, 253605083, -1464052776, -290906344, -1845071579, 1744461479, -1645028903, -990500766, 454426900, 1145100677, -1320427570, 1885478838, 1588799712, 1741583917) group by \"em\".\"year_id\", \"territoire\""} 
[2026-09-22 13:46:31] local.DEBUG: EmissionQueryBuilder {"context":"App\\Services\\Inventaire\\{closure}","mode":"agg","source_table":"observatoire.agg_petr","filter_level":"petr","display_level":null,"years":[2024],"sql":"select em.year_id, COALESCE(t.name, '(non rattaché)') AS territoire, ROUND((SUM(em.conso_ener_finale_clim_normal_gj)/3.6)::numeric, 2) AS conso_ener_finale_clim_normal_gj, ROUND((SUM(em.conso_ener_finale_clim_reel_gj)/3.6)::numeric, 2) AS conso_ener_finale_clim_reel_gj from \"observatoire\".\"agg_petr\" as \"em\" left join \"observatoire\".\"dim_territories\" as \"t\" on \"t\".\"id\" = \"em\".\"geo_id\" where \"em\".\"year_id\" in (2024) and \"em\".\"geo_id\" in (-1339322508) and \"em\".\"activity_id\" not in (-1961301967, 1409433884, -480772070, 253605083, -1464052776, -290906344, -1845071579, 1744461479, -1645028903, -990500766, 454426900, 1145100677, -1320427570, 1885478838, 1588799712, 1741583917) group by \"em\".\"year_id\", \"territoire\""} 
