[2026-08-06 06:42:45] local.DEBUG: ProductionQueryBuilder {"context":"App\\Services\\Inventaire\\{closure}","mode":"fact","source_table":"observatoire.fact_production","filter_level":"pnr","display_level":null,"years":[2024],"sql":"select fp.year_id, COALESCE(t.name, '(non rattaché)') AS territoire, COALESCE(fi.name, '(non rattaché)') AS filiere, 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 (-330926110)) 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 (-330926110) 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 (1298174201, -1583223985, 1270032335, -124248494, -1331514417, 1406800387, 1960668945, -1083934513, 1796054431, 462532502, -1497747537, 732180862, 1824193386, -1433878201, -844504743, 2065315848, -1014473487, -913750026, -1538118520, 897912354, -1843540233, 825071141, -1279318139, -543810268, -2097517554, -24603521, 403082322, -2094806066, 2023378393) inner join \"observatoire\".\"dim_filieres\" as \"fi\" on \"fi\".\"id\" = \"dtm_fi\".\"parent_id\" inner join \"observatoire\".\"dim_vecteurs\" as \"v\" on \"v\".\"id\" = \"fp\".\"vecteur_id\" where \"fp\".\"filiere_id\" in (-1316980943, -1589048475, 829965003, -1960216134, 801089390, 774281089, 1942610929, -929314708, 1506126584, 1413501954, -1193645855, 1033820579, -2102167500, -1312393098, 1498175839, 1716416743, -1936754040, 1371856852, 1963506075, -1839941303, 1961061561, -1004992653, 144162739, -243069253, -1982952820, -1958549795, 753002958, 1218982353, 193523191, 1680724918, -1109286771, -1165502792, 2023042180, 1500531356, 1723321957, 1340024063, -996979377, 1764268061, 1453260670, -1520867241, 2138005553, -498981429, -1392130500, 513682483, 1852304876, 967948000, -318804108, -1844241335, -1543929019, -1993658124, -1773246028, -1240650519, 1489167039, -992312423, 1200710728, 874142471) and \"fp\".\"vecteur_id\" in (3, 2, 1) group by \"fp\".\"year_id\", \"territoire\", \"filiere\", \"v\".\"name\""} 
[2026-08-06 06:42:45] local.DEBUG: ProductionQueryBuilder {"context":"App\\Services\\Inventaire\\{closure}","mode":"fact","source_table":"observatoire.fact_production","filter_level":"pnr","display_level":null,"years":[2024],"sql":"select fp.year_id, COALESCE(t.name, '(non rattaché)') AS territoire, COALESCE(fi.name, '(non rattaché)') AS filiere, 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 (-330926110)) 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 (-330926110) 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 (1298174201, -1583223985, 1270032335, -124248494, -1331514417, 1406800387, 1960668945, -1083934513, 1796054431, 462532502, -1497747537, 732180862, 1824193386, -1433878201, -844504743, 2065315848, -1014473487, -913750026, -1538118520, 897912354, -1843540233, 825071141, -1279318139, -543810268, -2097517554, -24603521, 403082322, -2094806066, 2023378393) inner join \"observatoire\".\"dim_filieres\" as \"fi\" on \"fi\".\"id\" = \"dtm_fi\".\"parent_id\" inner join \"observatoire\".\"dim_vecteurs\" as \"v\" on \"v\".\"id\" = \"fp\".\"vecteur_id\" where \"fp\".\"filiere_id\" in (-1316980943, -1589048475, 829965003, -1960216134, 801089390, 774281089, 1942610929, -929314708, 1506126584, 1413501954, -1193645855, 1033820579, -2102167500, -1312393098, 1498175839, 1716416743, -1936754040, 1371856852, 1963506075, -1839941303, 1961061561, -1004992653, 144162739, -243069253, -1982952820, -1958549795, 753002958, 1218982353, 193523191, 1680724918, -1109286771, -1165502792, 2023042180, 1500531356, 1723321957, 1340024063, -996979377, 1764268061, 1453260670, -1520867241, 2138005553, -498981429, -1392130500, 513682483, 1852304876, 967948000, -318804108, -1844241335, -1543929019, -1993658124, -1773246028, -1240650519, 1489167039, -992312423, 1200710728, 874142471) and \"fp\".\"vecteur_id\" in (3, 2, 1) group by \"fp\".\"year_id\", \"territoire\", \"filiere\", \"v\".\"name\""} 
[2026-08-06 08:41:05] local.DEBUG: ProductionQueryBuilder {"context":"App\\Services\\Inventaire\\{closure}","mode":"fact","source_table":"observatoire.fact_production","filter_level":"reg","display_level":null,"years":[2024],"sql":"select fp.year_id, COALESCE(t.name, '(non rattaché)') AS territoire, COALESCE(fi.name, '(non rattaché)') AS filiere, 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 (936037254)) 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 (936037254) 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 (1298174201, -1583223985, 1270032335, -124248494, -1331514417, 1406800387, 1960668945, -1083934513, 1796054431, 462532502, -1497747537, 732180862, 1824193386, -1433878201, -844504743, 2065315848, -1014473487) inner join \"observatoire\".\"dim_filieres\" as \"fi\" on \"fi\".\"id\" = \"dtm_fi\".\"parent_id\" inner join \"observatoire\".\"dim_vecteurs\" as \"v\" on \"v\".\"id\" = \"fp\".\"vecteur_id\" where \"fp\".\"filiere_id\" in (-1960216134, 774281089, -929314708, 1506126584, -1312393098, 1498175839, -1936754040, 1371856852, 1963506075, -1839941303, 1961061561, -1004992653, 144162739, -1982952820, -1958549795, 753002958, -1165502792, 1723321957, 1340024063, -996979377, 1764268061, 1453260670, -1520867241, -498981429, 513682483, 1852304876, -318804108, -1844241335, -1993658124, -1773246028, 1489167039, -992312423, 1200710728, 874142471) and \"fp\".\"vecteur_id\" in (3, 2, 1) 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\", \"v\".\"name\""} 
[2026-08-06 08:41:05] local.DEBUG: ProductionQueryBuilder {"context":"App\\Services\\Inventaire\\{closure}","mode":"fact","source_table":"observatoire.fact_production","filter_level":"reg","display_level":null,"years":[2024],"sql":"select fp.year_id, COALESCE(t.name, '(non rattaché)') AS territoire, COALESCE(fi.name, '(non rattaché)') AS filiere, 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 (936037254)) 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 (936037254) 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 (1298174201, -1583223985, 1270032335, -124248494, -1331514417, 1406800387, 1960668945, -1083934513, 1796054431, 462532502, -1497747537, 732180862, 1824193386, -1433878201, -844504743, 2065315848, -1014473487) inner join \"observatoire\".\"dim_filieres\" as \"fi\" on \"fi\".\"id\" = \"dtm_fi\".\"parent_id\" inner join \"observatoire\".\"dim_vecteurs\" as \"v\" on \"v\".\"id\" = \"fp\".\"vecteur_id\" where \"fp\".\"filiere_id\" in (-1960216134, 774281089, -929314708, 1506126584, -1312393098, 1498175839, -1936754040, 1371856852, 1963506075, -1839941303, 1961061561, -1004992653, 144162739, -1982952820, -1958549795, 753002958, -1165502792, 1723321957, 1340024063, -996979377, 1764268061, 1453260670, -1520867241, -498981429, 513682483, 1852304876, -318804108, -1844241335, -1993658124, -1773246028, 1489167039, -992312423, 1200710728, 874142471) and \"fp\".\"vecteur_id\" in (3, 2, 1) 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\", \"v\".\"name\""} 
[2026-08-06 08:44:28] local.DEBUG: EmissionQueryBuilder {"context":"App\\Services\\Inventaire\\{closure}","mode":"agg","source_table":"observatoire.agg_old_reg","filter_level":"old_reg","display_level":null,"years":[2010,2014,2015,2018,2020,2024],"sql":"select em.year_id, COALESCE(t.name, '(non rattaché)') AS territoire, COALESCE(a.name, '(non rattaché)') AS activite, ROUND(SUM(em.nh3_kg)::numeric, 4) AS nh3_kg, ROUND(SUM(em.ch4_kg_pcaet)::numeric, 4) AS ch4_kg_pcaet, ROUND(SUM(em.n2o_kg_pcaet)::numeric, 4) AS n2o_kg_pcaet, ROUND(SUM(em.prg_2021_teqco2_pcaet)::numeric, 4) AS prg_2021_teqco2_pcaet from \"observatoire\".\"agg_old_reg\" as \"em\" left join \"observatoire\".\"dim_territories\" as \"t\" on \"t\".\"id\" = \"em\".\"geo_id\" inner join \"observatoire\".\"dim_activity_memberships\" as \"dtm_a\" on \"dtm_a\".\"activity_id\" = \"em\".\"activity_id\" and \"dtm_a\".\"parent_id\" in (-622080275) inner join \"observatoire\".\"dim_activities\" as \"a\" on \"a\".\"id\" = \"dtm_a\".\"parent_id\" where \"em\".\"year_id\" in (2010, 2014, 2015, 2018, 2020, 2024) and \"em\".\"geo_id\" in (829921236) and \"em\".\"activity_id\" in (-843932025, -1915212800, -1645230407, -697951920, 118055960, 2128833364, -567369811, 310956635, -1918263047, -1246034248, -1144004711, 1839125859, -1345162752, 1735525248, -1978708979, 1574055369, 1663401832, -1987478087, -1171478393, 1770243570, -818258464, 1763501654, -893109849, 85619372, 350725182, -182420025, -1279064480, 775840687, -38219474, 1303189715, 1996142013, -183191368, -1110362267, 1734631443, -1781860008, -2140441286, 921165895, -966852427, 1784442077, 2101539831, 2106414096, -197558611, -2019686765, -1912564262, -694125069, -1166060768, -1929400904, 1741715211, -73273843, -604604043, 1371033649, 776279000, -1951358321, -475198975, 859934642, -1334310062, 344405547, -388600018, -955858860, 409891242, 1207010603, -1320908412, 1978588983, -263558204, 725270159, -1689620327, -394200259, 254882134, -1432964826, 971161973, -1573937312, 1983248498, -620524373, -1259394394, -1715977758, -115032065, 1173327443, -1710809284, -913831972) 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\", \"activite\""} 
[2026-08-06 08:44:59] local.DEBUG: EmissionQueryBuilder {"context":"App\\Services\\Inventaire\\{closure}","mode":"agg","source_table":"observatoire.agg_old_reg","filter_level":"old_reg","display_level":null,"years":[1990,2005,2010,2012,2014,2015,2016,2017,2018,2019,2020,2021,2022,2023,2024],"sql":"select em.year_id, COALESCE(t.name, '(non rattaché)') AS territoire, COALESCE(a.name, '(non rattaché)') AS activite, ROUND(SUM(em.nh3_kg)::numeric, 4) AS nh3_kg, ROUND(SUM(em.ch4_kg_pcaet)::numeric, 4) AS ch4_kg_pcaet, ROUND(SUM(em.n2o_kg_pcaet)::numeric, 4) AS n2o_kg_pcaet, ROUND(SUM(em.prg_2021_teqco2_pcaet)::numeric, 4) AS prg_2021_teqco2_pcaet from \"observatoire\".\"agg_old_reg\" as \"em\" left join \"observatoire\".\"dim_territories\" as \"t\" on \"t\".\"id\" = \"em\".\"geo_id\" inner join \"observatoire\".\"dim_activity_memberships\" as \"dtm_a\" on \"dtm_a\".\"activity_id\" = \"em\".\"activity_id\" and \"dtm_a\".\"parent_id\" in (-622080275) inner join \"observatoire\".\"dim_activities\" as \"a\" on \"a\".\"id\" = \"dtm_a\".\"parent_id\" where \"em\".\"year_id\" in (1990, 2005, 2010, 2012, 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021, 2022, 2023, 2024) and \"em\".\"geo_id\" in (829921236) and \"em\".\"activity_id\" in (-843932025, -1915212800, -1645230407, -697951920, 118055960, 2128833364, -567369811, 310956635, -1918263047, -1246034248, -1144004711, 1839125859, -1345162752, 1735525248, -1978708979, 1574055369, 1663401832, -1987478087, -1171478393, 1770243570, -818258464, 1763501654, -893109849, 85619372, 350725182, -182420025, -1279064480, 775840687, -38219474, 1303189715, 1996142013, -183191368, -1110362267, 1734631443, -1781860008, -2140441286, 921165895, -966852427, 1784442077, 2101539831, 2106414096, -197558611, -2019686765, -1912564262, -694125069, -1166060768, -1929400904, 1741715211, -73273843, -604604043, 1371033649, 776279000, -1951358321, -475198975, 859934642, -1334310062, 344405547, -388600018, -955858860, 409891242, 1207010603, -1320908412, 1978588983, -263558204, 725270159, -1689620327, -394200259, 254882134, -1432964826, 971161973, -1573937312, 1983248498, -620524373, -1259394394, -1715977758, -115032065, 1173327443, -1710809284, -913831972) 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\", \"activite\""} 
[2026-08-06 11:52:09] local.DEBUG: ProductionQueryBuilder {"context":"App\\Services\\Inventaire\\{closure}","mode":"fact","source_table":"observatoire.fact_production","filter_level":"pnr","display_level":null,"years":[2024],"sql":"select fp.year_id, COALESCE(t.name, '(non rattaché)') AS territoire, COALESCE(fi.name, '(non rattaché)') AS filiere, 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 (-330926110)) 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 (-330926110) 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 (1298174201, -1583223985, 1270032335, -124248494, -1331514417, 1406800387, 1960668945, -1083934513, 1796054431, 462532502, -1497747537, 732180862, 1824193386, -1433878201, -844504743, 2065315848, -1014473487) inner join \"observatoire\".\"dim_filieres\" as \"fi\" on \"fi\".\"id\" = \"dtm_fi\".\"parent_id\" inner join \"observatoire\".\"dim_vecteurs\" as \"v\" on \"v\".\"id\" = \"fp\".\"vecteur_id\" where \"fp\".\"filiere_id\" in (-1960216134, 774281089, -929314708, 1506126584, -1312393098, 1498175839, -1936754040, 1371856852, 1963506075, -1839941303, 1961061561, -1004992653, 144162739, -1982952820, -1958549795, 753002958, -1165502792, 1723321957, 1340024063, -996979377, 1764268061, 1453260670, -1520867241, -498981429, 513682483, 1852304876, -318804108, -1844241335, -1993658124, -1773246028, 1489167039, -992312423, 1200710728, 874142471) and \"fp\".\"vecteur_id\" in (3, 2, 1) 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\", \"v\".\"name\""} 
[2026-08-06 11:52:09] local.DEBUG: ProductionQueryBuilder {"context":"App\\Services\\Inventaire\\{closure}","mode":"fact","source_table":"observatoire.fact_production","filter_level":"pnr","display_level":null,"years":[2024],"sql":"select fp.year_id, COALESCE(t.name, '(non rattaché)') AS territoire, COALESCE(fi.name, '(non rattaché)') AS filiere, 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 (-330926110)) 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 (-330926110) 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 (1298174201, -1583223985, 1270032335, -124248494, -1331514417, 1406800387, 1960668945, -1083934513, 1796054431, 462532502, -1497747537, 732180862, 1824193386, -1433878201, -844504743, 2065315848, -1014473487) inner join \"observatoire\".\"dim_filieres\" as \"fi\" on \"fi\".\"id\" = \"dtm_fi\".\"parent_id\" inner join \"observatoire\".\"dim_vecteurs\" as \"v\" on \"v\".\"id\" = \"fp\".\"vecteur_id\" where \"fp\".\"filiere_id\" in (-1960216134, 774281089, -929314708, 1506126584, -1312393098, 1498175839, -1936754040, 1371856852, 1963506075, -1839941303, 1961061561, -1004992653, 144162739, -1982952820, -1958549795, 753002958, -1165502792, 1723321957, 1340024063, -996979377, 1764268061, 1453260670, -1520867241, -498981429, 513682483, 1852304876, -318804108, -1844241335, -1993658124, -1773246028, 1489167039, -992312423, 1200710728, 874142471) and \"fp\".\"vecteur_id\" in (3, 2, 1) 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\", \"v\".\"name\""} 
[2026-08-06 12:55:32] local.DEBUG: EmissionQueryBuilder {"context":"App\\Services\\Inventaire\\{closure}","mode":"agg","source_table":"observatoire.agg_epci","filter_level":"scot","display_level":"epci","years":[2024,2023,2022,2021,2020,2019,2018,2017,2016,2015,2014,2012,2010,2005,1990],"sql":"select em.year_id, COALESCE(t_parent.name, '(non rattaché)') AS territoire_parent, COALESCE(t.name, '(non rattaché)') AS territoire, COALESCE(a.name, '(non rattaché)') AS activite, COALESCE(f.name, '(non rattaché)') AS combustible, ROUND((SUM(em.conso_ener_finale_clim_normal_gj)/3.6)::numeric, 2) AS conso_ener_finale_clim_normal_gj, ROUND(SUM(em.co2_bio_kg)::numeric, 4) AS co2_bio_kg, ROUND(SUM(em.co2_ind_kg)::numeric, 4) AS co2_ind_kg, ROUND(SUM(em.tsp_kg)::numeric, 4) AS tsp_kg, ROUND(SUM(em.pm10_kg)::numeric, 4) AS pm10_kg, ROUND(SUM(em.pm2_5_kg)::numeric, 4) AS pm2_5_kg, ROUND(SUM(em.pm1_kg)::numeric, 4) AS pm1_kg, ROUND(SUM(em.bc_kg)::numeric, 4) AS bc_kg, ROUND(SUM(em.so2_kg)::numeric, 4) AS so2_kg, ROUND(SUM(em.nox_kg)::numeric, 4) AS nox_kg, ROUND(SUM(em.nh3_kg)::numeric, 4) AS nh3_kg, ROUND(SUM(em.co_kg)::numeric, 4) AS co_kg, ROUND(SUM(em.covnm_kg)::numeric, 4) AS covnm_kg, ROUND(SUM(em.co2_kg_pcaet)::numeric, 4) AS co2_kg_pcaet, ROUND(SUM(em.ch4_kg_pcaet)::numeric, 4) AS ch4_kg_pcaet, ROUND(SUM(em.n2o_kg_pcaet)::numeric, 4) AS n2o_kg_pcaet, ROUND(SUM(em.prg_2013_teqco2_pcaet)::numeric, 4) AS prg_2013_teqco2_pcaet, ROUND(SUM(em.prg_2021_teqco2_pcaet)::numeric, 4) AS prg_2021_teqco2_pcaet, ROUND(SUM(em.prg_fluores_2013_teqco2_pcaet)::numeric, 4) AS prg_fluores_2013_teqco2_pcaet, ROUND(SUM(em.prg_fluores_2021_teqco2_pcaet)::numeric, 4) AS prg_fluores_2021_teqco2_pcaet, ROUND((SUM(em.conso_ener_finale_clim_reel_gj)/3.6)::numeric, 2) AS conso_ener_finale_clim_reel_gj from \"observatoire\".\"agg_epci\" as \"em\" left join \"observatoire\".\"dim_territories\" as \"t\" on \"t\".\"id\" = \"em\".\"geo_id\" left join \"observatoire\".\"dim_territory_memberships\" as \"dtm_via\" on \"dtm_via\".\"parent_id\" = \"em\".\"geo_id\" left join \"observatoire\".\"dim_territory_memberships\" as \"dtm_parent\" on \"dtm_parent\".\"territory_id\" = \"dtm_via\".\"territory_id\" and \"dtm_parent\".\"parent_id\" in (268434814) left join \"observatoire\".\"dim_territories\" as \"t_parent\" on \"t_parent\".\"id\" = \"dtm_parent\".\"parent_id\" inner join \"observatoire\".\"dim_activity_memberships\" as \"dtm_a\" on \"dtm_a\".\"activity_id\" = \"em\".\"activity_id\" and \"dtm_a\".\"parent_id\" in (-622080275, 208862058, 74904297, 1926750763, 1705942411, -273970232, -1732845089, 14022040) inner join \"observatoire\".\"dim_activities\" as \"a\" on \"a\".\"id\" = \"dtm_a\".\"parent_id\" inner join \"observatoire\".\"dim_fuel_memberships\" as \"dtm_f\" on \"dtm_f\".\"fuel_id\" = \"em\".\"fuel_id\" and \"dtm_f\".\"parent_id\" in (-909450983, 396329696) inner join \"observatoire\".\"dim_fuels\" as \"f\" on \"f\".\"id\" = \"dtm_f\".\"parent_id\" where \"em\".\"year_id\" in (2024, 2023, 2022, 2021, 2020, 2019, 2018, 2017, 2016, 2015, 2014, 2012, 2010, 2005, 1990) and \"em\".\"geo_id\" in (-943236317, 1304264383) and \"em\".\"activity_id\" in (-2065015321, 1664202072, -1468143007, 1108698765, -697951920, 53616376, 911083398, -2129813176, -1918263047, -393206791, 562718587, 439277546, -858228785, 1839125859, 1824025864, 254468532, 1735525248, 240491429, 751538419, 1662919374, 1660135024, -2109039919, 97436677, -124660711, -1987478087, 722905366, -93516697, -818258464, -1982109166, 1409930224, -2034818798, 1822307428, -1758060949, 155019705, 1869212529, -609915394, 1481894613, 1395794963, 1695347196, 64335092, 921165895, -142018260, -482664252, 26668268, 942433737, 2101539831, -556896478, -289004236, 1180149453, -1100601087, 2113546912, -1166060768, -1270919973, 1741715211, -604604043, -1323823743, -65650287, -1771225083, 556015237, -497458774, 1890006254, -717879577, -475198975, 1306594475, 1087885866, -893165577, -1618922050, 409891242, -2075398489, 865842982, 1765509547, -1487210095, 76265396, 503239948, 1329377505, -2004721785, -1859723360, 1648387281, -731418973, -924061465, -519499276, -1689620327, 571578548, 1372013544, -2017652732, 506491597, 333711349, -1807500046, 680092381, 28083642, 879051533, -1167947622, 1900723648, -198132915, -567369811, 1273925006, 719954458, 1659802002, -1605866945, 1251539306, -1246034248, -2000350303, 122587945, 1855887801, 1307996793, -797747832, 1915345643, -719653191, -574407755, 747285232, 1757275487, 1312649538, 660808751, 1444864905, 82030098, 937605621, -1352377836, -407252425, 1763501654, -1405923019, 350725182, 1824837113, -1560607589, 682492730, 1303189715, 1734631443, 1243082219, 1140080948, -966852427, -632337157, 1663741761, -567757160, -1887790066, -837308181, -1623725498, -1436585389, -248116745, 2079193929, 1285586024, -1749430722, -717359299, -98448292, -853873446, -762838756, 1974523832, -1736763325, 859934642, 760580929, 1658855321, 138601578, 1153344103, 1280935296, -1951484904, 725270159, -1104146686, -225028528, -469721241, -1445420861, -2104684761, -1259394394, 1942080707, -913831972, 350561514, 1206983340, 1633334487, -1017289816, -843932025, -337017078, 454621909, 41079158, -1846591393, 804338617, 1352484195, 1426270099, -1732290900, 1353783048, -1078990055, -307626332, 2128833364, 1054770029, -740347188, -1430328674, 730376509, 504001257, -1859749546, -435776990, -2102767552, -933330074, 112476696, -446796902, -1546313589, 1663401832, 1104829866, -323474854, 906942419, -2009648112, -1608512036, 489987876, 301093584, 1663410790, -820564035, 1066750091, 2110173394, -2048915241, 859987309, 1134610842, -1219234331, 1099679168, 1855856603, -964500217, 21511964, 1388087176, 1967813158, -1063238036, -570672305, 2106414096, 1913359952, -2145734036, 342527500, 429059437, -295738415, -376271361, 827134186, 2047409618, 1519990054, -1487774563, 153764150, 1371033649, 776279000, 692870153, -1951358321, -889255393, 905336003, -1528757905, -1313144583, -189572407, 1219243506, -1959662381, -667330531, -1327037360, -388600018, -1768991392, 631501363, 1428443613, -794523335, -921669000, 50809254, -1151061648, -263558204, -1316167746, 254882134, -1432964826, 971161973, -869291431, -92274995, 2001828071, 717533312, -919698739, -115032065, -1710809284, 1440646841, 438839785, 1838130794, -1438657658, -2100037337, -1645230407, -35163706, -244693147, 747547873, -178006637, -316787613, -1609021450, 425592013, 1142721112, 1125960239, 342687363, -715496447, -466654990, -22267807, 2004972987, 373557710, -538767368, -583628804, 1231105243, -148499659, -1978708979, 1035684050, 595015853, 1713779118, 530155604, 1319740754, -1878882180, -578878727, 46178169, 1173150921, 707403387, 595454509, 2093595260, -178885722, 1933574569, 1689971204, 2099170107, -23642967, -893109849, -394754806, -1052690536, 373550100, -1337323363, 1447225472, 1276215965, 33249239, 730336352, -639410621, 932667705, -1839258623, 1911698987, -37699356, -982013561, -1459018491, -883327242, 1252179801, -450105656, -799071091, -1118403434, -432827018, -2125877781, -1464392700, -1334310062, 1371610371, -1652853783, 2106513667, -1320908412, -1981687934, 1764341119, -457559919, -1414713643, -394200259, -1573937312, -1087220802, 1173327443, 1942963054, -1193483522, 575519546, 1411111401, -50696485, -390568655, -1496086086, -273047452, 1578846294, -1189987097, -366685926, -390542442, 310956635, 494216435, -1591836854, -1958561345, 2001630306, -1144004711, 942233085, -1824930634, -35558533, -1345162752, 1713162907, -600367835, -1294709678, -356747582, -761498023, -1171478393, -487172781, -1805861555, 1024219564, 579293477, 1140113838, -1419278172, 2024238092, -182420025, -1904591798, 2117082238, 1974281097, -1743267982, -919487101, -770400240, -1939219148, 1687214361, -543242059, 1687613177, 692025924, 1949554747, -1071587566, 216692383, -1231239857, -301100043, 1184608045, 1570062812, 1744165561, -2024511393, -2117292693, -183910117, -1210454800, 933754793, 1924478818, 1584015331, -1929400904, -1865280307, 589008399, -125964541, 1640238785, -1829002824, 1898736760, 2108532170, 1044726750, 1923261691, 1227983953, -1363934197, 384410393, -2044885611, 919914692, 736532642, -1239747894, -1632648707, 2134862632, 1386497909, -1028097404, -1390684557, 2139709518, -1273156420, 1222056809, 539391017, 515802054, -2129230707, -1408995398, 632880332, 1772504308, -966063115, -1799725714, 21937287, 1477165581, 1253744553, 203783501, 1236677003, 689872, 1075533786, 1649769611, -97814566, -337441085, 675577244, 1367391544, 1379603351, 1049700765, 847335499, -14567500, -118886754, 1563060129, -1287483713, 1574055369, -1513139721, -1389614002, -1144038162, 775868583, -606258386, -1987052516, 1855178673, -2044004547, -1581253380, 1201608055, 85619372, -68842748, -1279064480, 2005250983, -307341145, 1996142013, 375123593, -271055130, -1781860008, 1096813866, 1849745898, 1007707851, -1605275342, -2140441286, 739923250, -704377305, -467115791, 1079222860, 242615640, -1837178453, 318613241, 347811431, -197558611, -2019686765, -980556544, 1553348267, 494206472, 1112036812, 1258750298, -842445917, 1544265955, -1912564262, -620488471, -889282158, 1299296056, 423665295, 1359890860, 1077172953, -73273843, -1659840926, 1392617912, -1081530607, 1303291967, 392392088, -2017022783, 1184793512, -1869570613, -955858860, 340061913, 618379975, 1011823494, -809881216, 1816787957, 1978588983, -1138006003, 2078237231, 1842692073, -620524373, -1715977758, -939991847, 1418466514, 1620817717, 1901794668, -1390883660, 1843164580, 1743133853, 578558002, -1932993837, -858994155, -1461717196, 1528030456, 1435696692, -648559285, -302632139, -1607714348, 223376167, 1711779466, 317524838, -1082127435, -1990228258, -668408596, 548540297, 1651542945, -1614026445, -1832238632, -1037581785, -1523665978, 600270447, -574372648, -763786315, 283393782, 1770243570, -734407698, -1703285931, -327559973, -1788065014, 960709480, -1814854069, -908948374, -436117987, 1682085334, -762279866, -183191368, 220080184, -57766241, -676428704, 1598532481, -1255434042, 1989286800, -1717498989, 1784442077, -1337246483, 1458785475, -1332638305, 145755964, -1074151148, 1287376035, 1362332800, 224035916, -23479538, -1409046242, -694125069, -566762324, -630866531, -347269928, 679566165, 276545043, 366390502, 288394184, -1914964681, -1286440751, -2020552257, 1678295557, -443199195, -1935636633, 2101386234, 818513443, -708582396, 1983248498, -1871954656, -161206170, -1859668546, -1151541471, 988479706, -1460631101, 971904816, -1519785494, -1915212800, -1888967964, -1802228876, -1296777115, 1201309406, -1531584106, 826582647, 118055960, -1132107069, -373631934, -1371339394, -1940516137, 1127749479, 1201351105, 68476456, -1744193508, -306861080, -980025384, -2072230927, -1736978617, 1572698384, 1177367976, -1156123924, 775840687, -1727327625, -38219474, -2063183380, -1110362267, 1684813422, -884896557, 1016574566, 803377337, 540645732, -1240017080, -1178332843, 2034593037, 1429295941, 1034344725, 1381736146, -62446596, -833249209, 1611256781, -1200401518, -518501295, 1572749265, -807863775, -746688917, 1656148124, -1201074141, 922162158, 302308805, 2079850451, 1040750617, 2011035759, 1436256879, 344405547, 1340950393, 1207010603, 1972919535, -2062377130, -975191328, -973132685, -1556578693, 931702417, -1990261158, 35115389, -1650124362, 500851691, -1315688156) and \"em\".\"activity_id\" not in (-1961301967, 1409433884, -480772070, 253605083, -1464052776, -290906344, -1845071579, 1744461479, -1645028903, -990500766, 454426900, 1145100677, -1320427570, 1885478838, 1588799712, 1741583917) and \"em\".\"fuel_id\" in (193009920, 759960937, 2035346998, -1759484656, -830241899, 23822128, -1163760912, -1660819109, 2066942576, 1898049943, 1484267897, -248609480, -1358379524, 347520938, 1385935766, -1049358887, 1587660764, -784501144, -2085768558, -1454921658, -762418863, -83169964, 2074953191, -704599906, -796112667, -1598383649, -2102937339, -683447095, 203685376, -1105469274, 1344636899, -1909685346, 1084264565, 1554441156, 281177182, -1906149501, 1615206468, -1616434285, 1194464230, -485896727, 1078099193, 1884553775, 1992193200, 1908804281, 842100943, 237320038, 1506772054, 78930848, -821358327, 1625357355, 16034538, 1801451108, -791711088, -601886031, -1592428522, 454816236, 48365780, 625058658, -1104883769, 1567694641, 1625866553, -1415973785, 512871173, -604367190, 13585771, 1914704207, 915693911, -2117240436, -68749161, -1294566295, 783920659, -52796417, 634974096, 556720288, -825344667, 208303479, -1668675215, -1994671959, 1875270378, 1488087421, 745451612, -1951840467, -267083638, 606829677, -664757232, -1068765758, 1611197846, -1673725551, -874737624, 1495275359, 1710276699, -1920227806, -202464622, 480850863, -1782263122, -1594592327, 566015977, -1912882661, 1855338849, -635957407, 1685905379, 618715071, -59538796, 1285184399, -507988172, 767873144, -1115210332, 1177006962, 609723321, -2111800721, 612491118, 1544538872, 521156911, -1272684724, -531598568, 221388039, 580937015, -1174609830, 1330229813, -1809684072) group by \"em\".\"year_id\", \"territoire_parent\", \"territoire\", \"activite\", \"combustible\""} 
[2026-08-06 12:55:35] local.DEBUG: EmissionQueryBuilder {"context":"App\\Services\\Inventaire\\{closure}","mode":"agg","source_table":"observatoire.agg_epci","filter_level":"scot","display_level":"epci","years":[2024,2023,2022,2021,2020,2019,2018,2017,2016,2015,2014,2012,2010,2005,1990],"sql":"select em.year_id, COALESCE(t_parent.name, '(non rattaché)') AS territoire_parent, COALESCE(t.name, '(non rattaché)') AS territoire, COALESCE(a.name, '(non rattaché)') AS activite, COALESCE(f.name, '(non rattaché)') AS combustible, ROUND((SUM(em.conso_ener_finale_clim_normal_gj)/3.6)::numeric, 2) AS conso_ener_finale_clim_normal_gj, ROUND(SUM(em.co2_bio_kg)::numeric, 4) AS co2_bio_kg, ROUND(SUM(em.co2_ind_kg)::numeric, 4) AS co2_ind_kg, ROUND(SUM(em.tsp_kg)::numeric, 4) AS tsp_kg, ROUND(SUM(em.pm10_kg)::numeric, 4) AS pm10_kg, ROUND(SUM(em.pm2_5_kg)::numeric, 4) AS pm2_5_kg, ROUND(SUM(em.pm1_kg)::numeric, 4) AS pm1_kg, ROUND(SUM(em.bc_kg)::numeric, 4) AS bc_kg, ROUND(SUM(em.so2_kg)::numeric, 4) AS so2_kg, ROUND(SUM(em.nox_kg)::numeric, 4) AS nox_kg, ROUND(SUM(em.nh3_kg)::numeric, 4) AS nh3_kg, ROUND(SUM(em.co_kg)::numeric, 4) AS co_kg, ROUND(SUM(em.covnm_kg)::numeric, 4) AS covnm_kg, ROUND(SUM(em.co2_kg_pcaet)::numeric, 4) AS co2_kg_pcaet, ROUND(SUM(em.ch4_kg_pcaet)::numeric, 4) AS ch4_kg_pcaet, ROUND(SUM(em.n2o_kg_pcaet)::numeric, 4) AS n2o_kg_pcaet, ROUND(SUM(em.prg_2013_teqco2_pcaet)::numeric, 4) AS prg_2013_teqco2_pcaet, ROUND(SUM(em.prg_2021_teqco2_pcaet)::numeric, 4) AS prg_2021_teqco2_pcaet, ROUND(SUM(em.prg_fluores_2013_teqco2_pcaet)::numeric, 4) AS prg_fluores_2013_teqco2_pcaet, ROUND(SUM(em.prg_fluores_2021_teqco2_pcaet)::numeric, 4) AS prg_fluores_2021_teqco2_pcaet, ROUND((SUM(em.conso_ener_finale_clim_reel_gj)/3.6)::numeric, 2) AS conso_ener_finale_clim_reel_gj from \"observatoire\".\"agg_epci\" as \"em\" left join \"observatoire\".\"dim_territories\" as \"t\" on \"t\".\"id\" = \"em\".\"geo_id\" left join \"observatoire\".\"dim_territory_memberships\" as \"dtm_via\" on \"dtm_via\".\"parent_id\" = \"em\".\"geo_id\" left join \"observatoire\".\"dim_territory_memberships\" as \"dtm_parent\" on \"dtm_parent\".\"territory_id\" = \"dtm_via\".\"territory_id\" and \"dtm_parent\".\"parent_id\" in (268434814) left join \"observatoire\".\"dim_territories\" as \"t_parent\" on \"t_parent\".\"id\" = \"dtm_parent\".\"parent_id\" inner join \"observatoire\".\"dim_activity_memberships\" as \"dtm_a\" on \"dtm_a\".\"activity_id\" = \"em\".\"activity_id\" and \"dtm_a\".\"parent_id\" in (-622080275, 208862058, 74904297, 1926750763, 1705942411, -273970232, -1732845089, 14022040) inner join \"observatoire\".\"dim_activities\" as \"a\" on \"a\".\"id\" = \"dtm_a\".\"parent_id\" inner join \"observatoire\".\"dim_fuel_memberships\" as \"dtm_f\" on \"dtm_f\".\"fuel_id\" = \"em\".\"fuel_id\" and \"dtm_f\".\"parent_id\" in (-909450983, 396329696) inner join \"observatoire\".\"dim_fuels\" as \"f\" on \"f\".\"id\" = \"dtm_f\".\"parent_id\" where \"em\".\"year_id\" in (2024, 2023, 2022, 2021, 2020, 2019, 2018, 2017, 2016, 2015, 2014, 2012, 2010, 2005, 1990) and \"em\".\"geo_id\" in (-943236317, 1304264383) and \"em\".\"activity_id\" in (-2065015321, 1664202072, -1468143007, 1108698765, -697951920, 53616376, 911083398, -2129813176, -1918263047, -393206791, 562718587, 439277546, -858228785, 1839125859, 1824025864, 254468532, 1735525248, 240491429, 751538419, 1662919374, 1660135024, -2109039919, 97436677, -124660711, -1987478087, 722905366, -93516697, -818258464, -1982109166, 1409930224, -2034818798, 1822307428, -1758060949, 155019705, 1869212529, -609915394, 1481894613, 1395794963, 1695347196, 64335092, 921165895, -142018260, -482664252, 26668268, 942433737, 2101539831, -556896478, -289004236, 1180149453, -1100601087, 2113546912, -1166060768, -1270919973, 1741715211, -604604043, -1323823743, -65650287, -1771225083, 556015237, -497458774, 1890006254, -717879577, -475198975, 1306594475, 1087885866, -893165577, -1618922050, 409891242, -2075398489, 865842982, 1765509547, -1487210095, 76265396, 503239948, 1329377505, -2004721785, -1859723360, 1648387281, -731418973, -924061465, -519499276, -1689620327, 571578548, 1372013544, -2017652732, 506491597, 333711349, -1807500046, 680092381, 28083642, 879051533, -1167947622, 1900723648, -198132915, -567369811, 1273925006, 719954458, 1659802002, -1605866945, 1251539306, -1246034248, -2000350303, 122587945, 1855887801, 1307996793, -797747832, 1915345643, -719653191, -574407755, 747285232, 1757275487, 1312649538, 660808751, 1444864905, 82030098, 937605621, -1352377836, -407252425, 1763501654, -1405923019, 350725182, 1824837113, -1560607589, 682492730, 1303189715, 1734631443, 1243082219, 1140080948, -966852427, -632337157, 1663741761, -567757160, -1887790066, -837308181, -1623725498, -1436585389, -248116745, 2079193929, 1285586024, -1749430722, -717359299, -98448292, -853873446, -762838756, 1974523832, -1736763325, 859934642, 760580929, 1658855321, 138601578, 1153344103, 1280935296, -1951484904, 725270159, -1104146686, -225028528, -469721241, -1445420861, -2104684761, -1259394394, 1942080707, -913831972, 350561514, 1206983340, 1633334487, -1017289816, -843932025, -337017078, 454621909, 41079158, -1846591393, 804338617, 1352484195, 1426270099, -1732290900, 1353783048, -1078990055, -307626332, 2128833364, 1054770029, -740347188, -1430328674, 730376509, 504001257, -1859749546, -435776990, -2102767552, -933330074, 112476696, -446796902, -1546313589, 1663401832, 1104829866, -323474854, 906942419, -2009648112, -1608512036, 489987876, 301093584, 1663410790, -820564035, 1066750091, 2110173394, -2048915241, 859987309, 1134610842, -1219234331, 1099679168, 1855856603, -964500217, 21511964, 1388087176, 1967813158, -1063238036, -570672305, 2106414096, 1913359952, -2145734036, 342527500, 429059437, -295738415, -376271361, 827134186, 2047409618, 1519990054, -1487774563, 153764150, 1371033649, 776279000, 692870153, -1951358321, -889255393, 905336003, -1528757905, -1313144583, -189572407, 1219243506, -1959662381, -667330531, -1327037360, -388600018, -1768991392, 631501363, 1428443613, -794523335, -921669000, 50809254, -1151061648, -263558204, -1316167746, 254882134, -1432964826, 971161973, -869291431, -92274995, 2001828071, 717533312, -919698739, -115032065, -1710809284, 1440646841, 438839785, 1838130794, -1438657658, -2100037337, -1645230407, -35163706, -244693147, 747547873, -178006637, -316787613, -1609021450, 425592013, 1142721112, 1125960239, 342687363, -715496447, -466654990, -22267807, 2004972987, 373557710, -538767368, -583628804, 1231105243, -148499659, -1978708979, 1035684050, 595015853, 1713779118, 530155604, 1319740754, -1878882180, -578878727, 46178169, 1173150921, 707403387, 595454509, 2093595260, -178885722, 1933574569, 1689971204, 2099170107, -23642967, -893109849, -394754806, -1052690536, 373550100, -1337323363, 1447225472, 1276215965, 33249239, 730336352, -639410621, 932667705, -1839258623, 1911698987, -37699356, -982013561, -1459018491, -883327242, 1252179801, -450105656, -799071091, -1118403434, -432827018, -2125877781, -1464392700, -1334310062, 1371610371, -1652853783, 2106513667, -1320908412, -1981687934, 1764341119, -457559919, -1414713643, -394200259, -1573937312, -1087220802, 1173327443, 1942963054, -1193483522, 575519546, 1411111401, -50696485, -390568655, -1496086086, -273047452, 1578846294, -1189987097, -366685926, -390542442, 310956635, 494216435, -1591836854, -1958561345, 2001630306, -1144004711, 942233085, -1824930634, -35558533, -1345162752, 1713162907, -600367835, -1294709678, -356747582, -761498023, -1171478393, -487172781, -1805861555, 1024219564, 579293477, 1140113838, -1419278172, 2024238092, -182420025, -1904591798, 2117082238, 1974281097, -1743267982, -919487101, -770400240, -1939219148, 1687214361, -543242059, 1687613177, 692025924, 1949554747, -1071587566, 216692383, -1231239857, -301100043, 1184608045, 1570062812, 1744165561, -2024511393, -2117292693, -183910117, -1210454800, 933754793, 1924478818, 1584015331, -1929400904, -1865280307, 589008399, -125964541, 1640238785, -1829002824, 1898736760, 2108532170, 1044726750, 1923261691, 1227983953, -1363934197, 384410393, -2044885611, 919914692, 736532642, -1239747894, -1632648707, 2134862632, 1386497909, -1028097404, -1390684557, 2139709518, -1273156420, 1222056809, 539391017, 515802054, -2129230707, -1408995398, 632880332, 1772504308, -966063115, -1799725714, 21937287, 1477165581, 1253744553, 203783501, 1236677003, 689872, 1075533786, 1649769611, -97814566, -337441085, 675577244, 1367391544, 1379603351, 1049700765, 847335499, -14567500, -118886754, 1563060129, -1287483713, 1574055369, -1513139721, -1389614002, -1144038162, 775868583, -606258386, -1987052516, 1855178673, -2044004547, -1581253380, 1201608055, 85619372, -68842748, -1279064480, 2005250983, -307341145, 1996142013, 375123593, -271055130, -1781860008, 1096813866, 1849745898, 1007707851, -1605275342, -2140441286, 739923250, -704377305, -467115791, 1079222860, 242615640, -1837178453, 318613241, 347811431, -197558611, -2019686765, -980556544, 1553348267, 494206472, 1112036812, 1258750298, -842445917, 1544265955, -1912564262, -620488471, -889282158, 1299296056, 423665295, 1359890860, 1077172953, -73273843, -1659840926, 1392617912, -1081530607, 1303291967, 392392088, -2017022783, 1184793512, -1869570613, -955858860, 340061913, 618379975, 1011823494, -809881216, 1816787957, 1978588983, -1138006003, 2078237231, 1842692073, -620524373, -1715977758, -939991847, 1418466514, 1620817717, 1901794668, -1390883660, 1843164580, 1743133853, 578558002, -1932993837, -858994155, -1461717196, 1528030456, 1435696692, -648559285, -302632139, -1607714348, 223376167, 1711779466, 317524838, -1082127435, -1990228258, -668408596, 548540297, 1651542945, -1614026445, -1832238632, -1037581785, -1523665978, 600270447, -574372648, -763786315, 283393782, 1770243570, -734407698, -1703285931, -327559973, -1788065014, 960709480, -1814854069, -908948374, -436117987, 1682085334, -762279866, -183191368, 220080184, -57766241, -676428704, 1598532481, -1255434042, 1989286800, -1717498989, 1784442077, -1337246483, 1458785475, -1332638305, 145755964, -1074151148, 1287376035, 1362332800, 224035916, -23479538, -1409046242, -694125069, -566762324, -630866531, -347269928, 679566165, 276545043, 366390502, 288394184, -1914964681, -1286440751, -2020552257, 1678295557, -443199195, -1935636633, 2101386234, 818513443, -708582396, 1983248498, -1871954656, -161206170, -1859668546, -1151541471, 988479706, -1460631101, 971904816, -1519785494, -1915212800, -1888967964, -1802228876, -1296777115, 1201309406, -1531584106, 826582647, 118055960, -1132107069, -373631934, -1371339394, -1940516137, 1127749479, 1201351105, 68476456, -1744193508, -306861080, -980025384, -2072230927, -1736978617, 1572698384, 1177367976, -1156123924, 775840687, -1727327625, -38219474, -2063183380, -1110362267, 1684813422, -884896557, 1016574566, 803377337, 540645732, -1240017080, -1178332843, 2034593037, 1429295941, 1034344725, 1381736146, -62446596, -833249209, 1611256781, -1200401518, -518501295, 1572749265, -807863775, -746688917, 1656148124, -1201074141, 922162158, 302308805, 2079850451, 1040750617, 2011035759, 1436256879, 344405547, 1340950393, 1207010603, 1972919535, -2062377130, -975191328, -973132685, -1556578693, 931702417, -1990261158, 35115389, -1650124362, 500851691, -1315688156) and \"em\".\"activity_id\" not in (-1961301967, 1409433884, -480772070, 253605083, -1464052776, -290906344, -1845071579, 1744461479, -1645028903, -990500766, 454426900, 1145100677, -1320427570, 1885478838, 1588799712, 1741583917) and \"em\".\"fuel_id\" in (193009920, 759960937, 2035346998, -1759484656, -830241899, 23822128, -1163760912, -1660819109, 2066942576, 1898049943, 1484267897, -248609480, -1358379524, 347520938, 1385935766, -1049358887, 1587660764, -784501144, -2085768558, -1454921658, -762418863, -83169964, 2074953191, -704599906, -796112667, -1598383649, -2102937339, -683447095, 203685376, -1105469274, 1344636899, -1909685346, 1084264565, 1554441156, 281177182, -1906149501, 1615206468, -1616434285, 1194464230, -485896727, 1078099193, 1884553775, 1992193200, 1908804281, 842100943, 237320038, 1506772054, 78930848, -821358327, 1625357355, 16034538, 1801451108, -791711088, -601886031, -1592428522, 454816236, 48365780, 625058658, -1104883769, 1567694641, 1625866553, -1415973785, 512871173, -604367190, 13585771, 1914704207, 915693911, -2117240436, -68749161, -1294566295, 783920659, -52796417, 634974096, 556720288, -825344667, 208303479, -1668675215, -1994671959, 1875270378, 1488087421, 745451612, -1951840467, -267083638, 606829677, -664757232, -1068765758, 1611197846, -1673725551, -874737624, 1495275359, 1710276699, -1920227806, -202464622, 480850863, -1782263122, -1594592327, 566015977, -1912882661, 1855338849, -635957407, 1685905379, 618715071, -59538796, 1285184399, -507988172, 767873144, -1115210332, 1177006962, 609723321, -2111800721, 612491118, 1544538872, 521156911, -1272684724, -531598568, 221388039, 580937015, -1174609830, 1330229813, -1809684072) group by \"em\".\"year_id\", \"territoire_parent\", \"territoire\", \"activite\", \"combustible\""} 
[2026-08-06 12:55:46] local.DEBUG: EmissionQueryBuilder {"context":"App\\Services\\Inventaire\\{closure}","mode":"agg","source_table":"observatoire.agg_epci","filter_level":"scot","display_level":"epci","years":[2024,2023,2022,2021,2020,2019,2018,2017,2016,2015,2014,2012,2010,2005,1990],"sql":"select em.year_id, COALESCE(t_parent.name, '(non rattaché)') AS territoire_parent, COALESCE(t.name, '(non rattaché)') AS territoire, COALESCE(a.name, '(non rattaché)') AS activite, COALESCE(f.name, '(non rattaché)') AS combustible, ROUND((SUM(em.conso_ener_finale_clim_normal_gj)/3.6)::numeric, 2) AS conso_ener_finale_clim_normal_gj, ROUND(SUM(em.co2_bio_kg)::numeric, 4) AS co2_bio_kg, ROUND(SUM(em.co2_ind_kg)::numeric, 4) AS co2_ind_kg, ROUND(SUM(em.tsp_kg)::numeric, 4) AS tsp_kg, ROUND(SUM(em.pm10_kg)::numeric, 4) AS pm10_kg, ROUND(SUM(em.pm2_5_kg)::numeric, 4) AS pm2_5_kg, ROUND(SUM(em.pm1_kg)::numeric, 4) AS pm1_kg, ROUND(SUM(em.bc_kg)::numeric, 4) AS bc_kg, ROUND(SUM(em.so2_kg)::numeric, 4) AS so2_kg, ROUND(SUM(em.nox_kg)::numeric, 4) AS nox_kg, ROUND(SUM(em.nh3_kg)::numeric, 4) AS nh3_kg, ROUND(SUM(em.co_kg)::numeric, 4) AS co_kg, ROUND(SUM(em.covnm_kg)::numeric, 4) AS covnm_kg, ROUND(SUM(em.co2_kg_pcaet)::numeric, 4) AS co2_kg_pcaet, ROUND(SUM(em.ch4_kg_pcaet)::numeric, 4) AS ch4_kg_pcaet, ROUND(SUM(em.n2o_kg_pcaet)::numeric, 4) AS n2o_kg_pcaet, ROUND(SUM(em.prg_2013_teqco2_pcaet)::numeric, 4) AS prg_2013_teqco2_pcaet, ROUND(SUM(em.prg_2021_teqco2_pcaet)::numeric, 4) AS prg_2021_teqco2_pcaet, ROUND(SUM(em.prg_fluores_2013_teqco2_pcaet)::numeric, 4) AS prg_fluores_2013_teqco2_pcaet, ROUND(SUM(em.prg_fluores_2021_teqco2_pcaet)::numeric, 4) AS prg_fluores_2021_teqco2_pcaet, ROUND((SUM(em.conso_ener_finale_clim_reel_gj)/3.6)::numeric, 2) AS conso_ener_finale_clim_reel_gj from \"observatoire\".\"agg_epci\" as \"em\" left join \"observatoire\".\"dim_territories\" as \"t\" on \"t\".\"id\" = \"em\".\"geo_id\" left join \"observatoire\".\"dim_territory_memberships\" as \"dtm_via\" on \"dtm_via\".\"parent_id\" = \"em\".\"geo_id\" left join \"observatoire\".\"dim_territory_memberships\" as \"dtm_parent\" on \"dtm_parent\".\"territory_id\" = \"dtm_via\".\"territory_id\" and \"dtm_parent\".\"parent_id\" in (268434814) left join \"observatoire\".\"dim_territories\" as \"t_parent\" on \"t_parent\".\"id\" = \"dtm_parent\".\"parent_id\" inner join \"observatoire\".\"dim_activity_memberships\" as \"dtm_a\" on \"dtm_a\".\"activity_id\" = \"em\".\"activity_id\" and \"dtm_a\".\"parent_id\" in (-622080275, 208862058, 74904297, 1926750763, 1705942411, -273970232, -1732845089, 14022040) inner join \"observatoire\".\"dim_activities\" as \"a\" on \"a\".\"id\" = \"dtm_a\".\"parent_id\" inner join \"observatoire\".\"dim_fuel_memberships\" as \"dtm_f\" on \"dtm_f\".\"fuel_id\" = \"em\".\"fuel_id\" and \"dtm_f\".\"parent_id\" in (-909450983, 396329696) inner join \"observatoire\".\"dim_fuels\" as \"f\" on \"f\".\"id\" = \"dtm_f\".\"parent_id\" where \"em\".\"year_id\" in (2024, 2023, 2022, 2021, 2020, 2019, 2018, 2017, 2016, 2015, 2014, 2012, 2010, 2005, 1990) and \"em\".\"geo_id\" in (-943236317, 1304264383) and \"em\".\"activity_id\" in (-2065015321, 1664202072, -1468143007, 1108698765, -697951920, 53616376, 911083398, -2129813176, -1918263047, -393206791, 562718587, 439277546, -858228785, 1839125859, 1824025864, 254468532, 1735525248, 240491429, 751538419, 1662919374, 1660135024, -2109039919, 97436677, -124660711, -1987478087, 722905366, -93516697, -818258464, -1982109166, 1409930224, -2034818798, 1822307428, -1758060949, 155019705, 1869212529, -609915394, 1481894613, 1395794963, 1695347196, 64335092, 921165895, -142018260, -482664252, 26668268, 942433737, 2101539831, -556896478, -289004236, 1180149453, -1100601087, 2113546912, -1166060768, -1270919973, 1741715211, -604604043, -1323823743, -65650287, -1771225083, 556015237, -497458774, 1890006254, -717879577, -475198975, 1306594475, 1087885866, -893165577, -1618922050, 409891242, -2075398489, 865842982, 1765509547, -1487210095, 76265396, 503239948, 1329377505, -2004721785, -1859723360, 1648387281, -731418973, -924061465, -519499276, -1689620327, 571578548, 1372013544, -2017652732, 506491597, 333711349, -1807500046, 680092381, 28083642, 879051533, -1167947622, 1900723648, -198132915, -567369811, 1273925006, 719954458, 1659802002, -1605866945, 1251539306, -1246034248, -2000350303, 122587945, 1855887801, 1307996793, -797747832, 1915345643, -719653191, -574407755, 747285232, 1757275487, 1312649538, 660808751, 1444864905, 82030098, 937605621, -1352377836, -407252425, 1763501654, -1405923019, 350725182, 1824837113, -1560607589, 682492730, 1303189715, 1734631443, 1243082219, 1140080948, -966852427, -632337157, 1663741761, -567757160, -1887790066, -837308181, -1623725498, -1436585389, -248116745, 2079193929, 1285586024, -1749430722, -717359299, -98448292, -853873446, -762838756, 1974523832, -1736763325, 859934642, 760580929, 1658855321, 138601578, 1153344103, 1280935296, -1951484904, 725270159, -1104146686, -225028528, -469721241, -1445420861, -2104684761, -1259394394, 1942080707, -913831972, 350561514, 1206983340, 1633334487, -1017289816, -843932025, -337017078, 454621909, 41079158, -1846591393, 804338617, 1352484195, 1426270099, -1732290900, 1353783048, -1078990055, -307626332, 2128833364, 1054770029, -740347188, -1430328674, 730376509, 504001257, -1859749546, -435776990, -2102767552, -933330074, 112476696, -446796902, -1546313589, 1663401832, 1104829866, -323474854, 906942419, -2009648112, -1608512036, 489987876, 301093584, 1663410790, -820564035, 1066750091, 2110173394, -2048915241, 859987309, 1134610842, -1219234331, 1099679168, 1855856603, -964500217, 21511964, 1388087176, 1967813158, -1063238036, -570672305, 2106414096, 1913359952, -2145734036, 342527500, 429059437, -295738415, -376271361, 827134186, 2047409618, 1519990054, -1487774563, 153764150, 1371033649, 776279000, 692870153, -1951358321, -889255393, 905336003, -1528757905, -1313144583, -189572407, 1219243506, -1959662381, -667330531, -1327037360, -388600018, -1768991392, 631501363, 1428443613, -794523335, -921669000, 50809254, -1151061648, -263558204, -1316167746, 254882134, -1432964826, 971161973, -869291431, -92274995, 2001828071, 717533312, -919698739, -115032065, -1710809284, 1440646841, 438839785, 1838130794, -1438657658, -2100037337, -1645230407, -35163706, -244693147, 747547873, -178006637, -316787613, -1609021450, 425592013, 1142721112, 1125960239, 342687363, -715496447, -466654990, -22267807, 2004972987, 373557710, -538767368, -583628804, 1231105243, -148499659, -1978708979, 1035684050, 595015853, 1713779118, 530155604, 1319740754, -1878882180, -578878727, 46178169, 1173150921, 707403387, 595454509, 2093595260, -178885722, 1933574569, 1689971204, 2099170107, -23642967, -893109849, -394754806, -1052690536, 373550100, -1337323363, 1447225472, 1276215965, 33249239, 730336352, -639410621, 932667705, -1839258623, 1911698987, -37699356, -982013561, -1459018491, -883327242, 1252179801, -450105656, -799071091, -1118403434, -432827018, -2125877781, -1464392700, -1334310062, 1371610371, -1652853783, 2106513667, -1320908412, -1981687934, 1764341119, -457559919, -1414713643, -394200259, -1573937312, -1087220802, 1173327443, 1942963054, -1193483522, 575519546, 1411111401, -50696485, -390568655, -1496086086, -273047452, 1578846294, -1189987097, -366685926, -390542442, 310956635, 494216435, -1591836854, -1958561345, 2001630306, -1144004711, 942233085, -1824930634, -35558533, -1345162752, 1713162907, -600367835, -1294709678, -356747582, -761498023, -1171478393, -487172781, -1805861555, 1024219564, 579293477, 1140113838, -1419278172, 2024238092, -182420025, -1904591798, 2117082238, 1974281097, -1743267982, -919487101, -770400240, -1939219148, 1687214361, -543242059, 1687613177, 692025924, 1949554747, -1071587566, 216692383, -1231239857, -301100043, 1184608045, 1570062812, 1744165561, -2024511393, -2117292693, -183910117, -1210454800, 933754793, 1924478818, 1584015331, -1929400904, -1865280307, 589008399, -125964541, 1640238785, -1829002824, 1898736760, 2108532170, 1044726750, 1923261691, 1227983953, -1363934197, 384410393, -2044885611, 919914692, 736532642, -1239747894, -1632648707, 2134862632, 1386497909, -1028097404, -1390684557, 2139709518, -1273156420, 1222056809, 539391017, 515802054, -2129230707, -1408995398, 632880332, 1772504308, -966063115, -1799725714, 21937287, 1477165581, 1253744553, 203783501, 1236677003, 689872, 1075533786, 1649769611, -97814566, -337441085, 675577244, 1367391544, 1379603351, 1049700765, 847335499, -14567500, -118886754, 1563060129, -1287483713, 1574055369, -1513139721, -1389614002, -1144038162, 775868583, -606258386, -1987052516, 1855178673, -2044004547, -1581253380, 1201608055, 85619372, -68842748, -1279064480, 2005250983, -307341145, 1996142013, 375123593, -271055130, -1781860008, 1096813866, 1849745898, 1007707851, -1605275342, -2140441286, 739923250, -704377305, -467115791, 1079222860, 242615640, -1837178453, 318613241, 347811431, -197558611, -2019686765, -980556544, 1553348267, 494206472, 1112036812, 1258750298, -842445917, 1544265955, -1912564262, -620488471, -889282158, 1299296056, 423665295, 1359890860, 1077172953, -73273843, -1659840926, 1392617912, -1081530607, 1303291967, 392392088, -2017022783, 1184793512, -1869570613, -955858860, 340061913, 618379975, 1011823494, -809881216, 1816787957, 1978588983, -1138006003, 2078237231, 1842692073, -620524373, -1715977758, -939991847, 1418466514, 1620817717, 1901794668, -1390883660, 1843164580, 1743133853, 578558002, -1932993837, -858994155, -1461717196, 1528030456, 1435696692, -648559285, -302632139, -1607714348, 223376167, 1711779466, 317524838, -1082127435, -1990228258, -668408596, 548540297, 1651542945, -1614026445, -1832238632, -1037581785, -1523665978, 600270447, -574372648, -763786315, 283393782, 1770243570, -734407698, -1703285931, -327559973, -1788065014, 960709480, -1814854069, -908948374, -436117987, 1682085334, -762279866, -183191368, 220080184, -57766241, -676428704, 1598532481, -1255434042, 1989286800, -1717498989, 1784442077, -1337246483, 1458785475, -1332638305, 145755964, -1074151148, 1287376035, 1362332800, 224035916, -23479538, -1409046242, -694125069, -566762324, -630866531, -347269928, 679566165, 276545043, 366390502, 288394184, -1914964681, -1286440751, -2020552257, 1678295557, -443199195, -1935636633, 2101386234, 818513443, -708582396, 1983248498, -1871954656, -161206170, -1859668546, -1151541471, 988479706, -1460631101, 971904816, -1519785494, -1915212800, -1888967964, -1802228876, -1296777115, 1201309406, -1531584106, 826582647, 118055960, -1132107069, -373631934, -1371339394, -1940516137, 1127749479, 1201351105, 68476456, -1744193508, -306861080, -980025384, -2072230927, -1736978617, 1572698384, 1177367976, -1156123924, 775840687, -1727327625, -38219474, -2063183380, -1110362267, 1684813422, -884896557, 1016574566, 803377337, 540645732, -1240017080, -1178332843, 2034593037, 1429295941, 1034344725, 1381736146, -62446596, -833249209, 1611256781, -1200401518, -518501295, 1572749265, -807863775, -746688917, 1656148124, -1201074141, 922162158, 302308805, 2079850451, 1040750617, 2011035759, 1436256879, 344405547, 1340950393, 1207010603, 1972919535, -2062377130, -975191328, -973132685, -1556578693, 931702417, -1990261158, 35115389, -1650124362, 500851691, -1315688156) and \"em\".\"activity_id\" not in (-1961301967, 1409433884, -480772070, 253605083, -1464052776, -290906344, -1845071579, 1744461479, -1645028903, -990500766, 454426900, 1145100677, -1320427570, 1885478838, 1588799712, 1741583917) and \"em\".\"fuel_id\" in (193009920, 759960937, 2035346998, -1759484656, -830241899, 23822128, -1163760912, -1660819109, 2066942576, 1898049943, 1484267897, -248609480, -1358379524, 347520938, 1385935766, -1049358887, 1587660764, -784501144, -2085768558, -1454921658, -762418863, -83169964, 2074953191, -704599906, -796112667, -1598383649, -2102937339, -683447095, 203685376, -1105469274, 1344636899, -1909685346, 1084264565, 1554441156, 281177182, -1906149501, 1615206468, -1616434285, 1194464230, -485896727, 1078099193, 1884553775, 1992193200, 1908804281, 842100943, 237320038, 1506772054, 78930848, -821358327, 1625357355, 16034538, 1801451108, -791711088, -601886031, -1592428522, 454816236, 48365780, 625058658, -1104883769, 1567694641, 1625866553, -1415973785, 512871173, -604367190, 13585771, 1914704207, 915693911, -2117240436, -68749161, -1294566295, 783920659, -52796417, 634974096, 556720288, -825344667, 208303479, -1668675215, -1994671959, 1875270378, 1488087421, 745451612, -1951840467, -267083638, 606829677, -664757232, -1068765758, 1611197846, -1673725551, -874737624, 1495275359, 1710276699, -1920227806, -202464622, 480850863, -1782263122, -1594592327, 566015977, -1912882661, 1855338849, -635957407, 1685905379, 618715071, -59538796, 1285184399, -507988172, 767873144, -1115210332, 1177006962, 609723321, -2111800721, 612491118, 1544538872, 521156911, -1272684724, -531598568, 221388039, 580937015, -1174609830, 1330229813, -1809684072) group by \"em\".\"year_id\", \"territoire_parent\", \"territoire\", \"activite\", \"combustible\""} 
[2026-08-06 12:59:56] local.DEBUG: EmissionQueryBuilder {"context":"App\\Services\\Inventaire\\{closure}","mode":"agg","source_table":"observatoire.agg_epci","filter_level":"scot","display_level":"epci","years":[2024,2023,2022,2021,2020,2019,2018,2017,2016,2015,2014,2012,2010,2005,1990],"sql":"select em.year_id, COALESCE(t_parent.name, '(non rattaché)') AS territoire_parent, COALESCE(t.name, '(non rattaché)') AS territoire, COALESCE(a.name, '(non rattaché)') AS activite, COALESCE(f.name, '(non rattaché)') AS combustible, ROUND((SUM(em.conso_ener_finale_clim_normal_gj)/3.6)::numeric, 2) AS conso_ener_finale_clim_normal_gj, ROUND(SUM(em.co2_bio_kg)::numeric, 4) AS co2_bio_kg, ROUND(SUM(em.co2_ind_kg)::numeric, 4) AS co2_ind_kg, ROUND(SUM(em.tsp_kg)::numeric, 4) AS tsp_kg, ROUND(SUM(em.pm10_kg)::numeric, 4) AS pm10_kg, ROUND(SUM(em.pm2_5_kg)::numeric, 4) AS pm2_5_kg, ROUND(SUM(em.pm1_kg)::numeric, 4) AS pm1_kg, ROUND(SUM(em.bc_kg)::numeric, 4) AS bc_kg, ROUND(SUM(em.so2_kg)::numeric, 4) AS so2_kg, ROUND(SUM(em.nox_kg)::numeric, 4) AS nox_kg, ROUND(SUM(em.nh3_kg)::numeric, 4) AS nh3_kg, ROUND(SUM(em.co_kg)::numeric, 4) AS co_kg, ROUND(SUM(em.covnm_kg)::numeric, 4) AS covnm_kg, ROUND(SUM(em.co2_kg_pcaet)::numeric, 4) AS co2_kg_pcaet, ROUND(SUM(em.ch4_kg_pcaet)::numeric, 4) AS ch4_kg_pcaet, ROUND(SUM(em.n2o_kg_pcaet)::numeric, 4) AS n2o_kg_pcaet, ROUND(SUM(em.prg_2013_teqco2_pcaet)::numeric, 4) AS prg_2013_teqco2_pcaet, ROUND(SUM(em.prg_2021_teqco2_pcaet)::numeric, 4) AS prg_2021_teqco2_pcaet, ROUND(SUM(em.prg_fluores_2013_teqco2_pcaet)::numeric, 4) AS prg_fluores_2013_teqco2_pcaet, ROUND(SUM(em.prg_fluores_2021_teqco2_pcaet)::numeric, 4) AS prg_fluores_2021_teqco2_pcaet, ROUND((SUM(em.conso_ener_finale_clim_reel_gj)/3.6)::numeric, 2) AS conso_ener_finale_clim_reel_gj from \"observatoire\".\"agg_epci\" as \"em\" left join \"observatoire\".\"dim_territories\" as \"t\" on \"t\".\"id\" = \"em\".\"geo_id\" left join \"observatoire\".\"dim_territory_memberships\" as \"dtm_via\" on \"dtm_via\".\"parent_id\" = \"em\".\"geo_id\" left join \"observatoire\".\"dim_territory_memberships\" as \"dtm_parent\" on \"dtm_parent\".\"territory_id\" = \"dtm_via\".\"territory_id\" and \"dtm_parent\".\"parent_id\" in (268434814) left join \"observatoire\".\"dim_territories\" as \"t_parent\" on \"t_parent\".\"id\" = \"dtm_parent\".\"parent_id\" inner join \"observatoire\".\"dim_activity_memberships\" as \"dtm_a\" on \"dtm_a\".\"activity_id\" = \"em\".\"activity_id\" and \"dtm_a\".\"parent_id\" in (-622080275, 208862058, 74904297, 1926750763, 1705942411, -273970232, -1732845089, 14022040) inner join \"observatoire\".\"dim_activities\" as \"a\" on \"a\".\"id\" = \"dtm_a\".\"parent_id\" inner join \"observatoire\".\"dim_fuel_memberships\" as \"dtm_f\" on \"dtm_f\".\"fuel_id\" = \"em\".\"fuel_id\" and \"dtm_f\".\"parent_id\" in (-909450983, 396329696) inner join \"observatoire\".\"dim_fuels\" as \"f\" on \"f\".\"id\" = \"dtm_f\".\"parent_id\" where \"em\".\"year_id\" in (2024, 2023, 2022, 2021, 2020, 2019, 2018, 2017, 2016, 2015, 2014, 2012, 2010, 2005, 1990) and \"em\".\"geo_id\" in (-943236317, 1304264383) and \"em\".\"activity_id\" in (-2065015321, 1664202072, -1468143007, 1108698765, -697951920, 53616376, 911083398, -2129813176, -1918263047, -393206791, 562718587, 439277546, -858228785, 1839125859, 1824025864, 254468532, 1735525248, 240491429, 751538419, 1662919374, 1660135024, -2109039919, 97436677, -124660711, -1987478087, 722905366, -93516697, -818258464, -1982109166, 1409930224, -2034818798, 1822307428, -1758060949, 155019705, 1869212529, -609915394, 1481894613, 1395794963, 1695347196, 64335092, 921165895, -142018260, -482664252, 26668268, 942433737, 2101539831, -556896478, -289004236, 1180149453, -1100601087, 2113546912, -1166060768, -1270919973, 1741715211, -604604043, -1323823743, -65650287, -1771225083, 556015237, -497458774, 1890006254, -717879577, -475198975, 1306594475, 1087885866, -893165577, -1618922050, 409891242, -2075398489, 865842982, 1765509547, -1487210095, 76265396, 503239948, 1329377505, -2004721785, -1859723360, 1648387281, -731418973, -924061465, -519499276, -1689620327, 571578548, 1372013544, -2017652732, 506491597, 333711349, -1807500046, 680092381, 28083642, 879051533, -1167947622, 1900723648, -198132915, -567369811, 1273925006, 719954458, 1659802002, -1605866945, 1251539306, -1246034248, -2000350303, 122587945, 1855887801, 1307996793, -797747832, 1915345643, -719653191, -574407755, 747285232, 1757275487, 1312649538, 660808751, 1444864905, 82030098, 937605621, -1352377836, -407252425, 1763501654, -1405923019, 350725182, 1824837113, -1560607589, 682492730, 1303189715, 1734631443, 1243082219, 1140080948, -966852427, -632337157, 1663741761, -567757160, -1887790066, -837308181, -1623725498, -1436585389, -248116745, 2079193929, 1285586024, -1749430722, -717359299, -98448292, -853873446, -762838756, 1974523832, -1736763325, 859934642, 760580929, 1658855321, 138601578, 1153344103, 1280935296, -1951484904, 725270159, -1104146686, -225028528, -469721241, -1445420861, -2104684761, -1259394394, 1942080707, -913831972, 350561514, 1206983340, 1633334487, -1017289816, -843932025, -337017078, 454621909, 41079158, -1846591393, 804338617, 1352484195, 1426270099, -1732290900, 1353783048, -1078990055, -307626332, 2128833364, 1054770029, -740347188, -1430328674, 730376509, 504001257, -1859749546, -435776990, -2102767552, -933330074, 112476696, -446796902, -1546313589, 1663401832, 1104829866, -323474854, 906942419, -2009648112, -1608512036, 489987876, 301093584, 1663410790, -820564035, 1066750091, 2110173394, -2048915241, 859987309, 1134610842, -1219234331, 1099679168, 1855856603, -964500217, 21511964, 1388087176, 1967813158, -1063238036, -570672305, 2106414096, 1913359952, -2145734036, 342527500, 429059437, -295738415, -376271361, 827134186, 2047409618, 1519990054, -1487774563, 153764150, 1371033649, 776279000, 692870153, -1951358321, -889255393, 905336003, -1528757905, -1313144583, -189572407, 1219243506, -1959662381, -667330531, -1327037360, -388600018, -1768991392, 631501363, 1428443613, -794523335, -921669000, 50809254, -1151061648, -263558204, -1316167746, 254882134, -1432964826, 971161973, -869291431, -92274995, 2001828071, 717533312, -919698739, -115032065, -1710809284, 1440646841, 438839785, 1838130794, -1438657658, -2100037337, -1645230407, -35163706, -244693147, 747547873, -178006637, -316787613, -1609021450, 425592013, 1142721112, 1125960239, 342687363, -715496447, -466654990, -22267807, 2004972987, 373557710, -538767368, -583628804, 1231105243, -148499659, -1978708979, 1035684050, 595015853, 1713779118, 530155604, 1319740754, -1878882180, -578878727, 46178169, 1173150921, 707403387, 595454509, 2093595260, -178885722, 1933574569, 1689971204, 2099170107, -23642967, -893109849, -394754806, -1052690536, 373550100, -1337323363, 1447225472, 1276215965, 33249239, 730336352, -639410621, 932667705, -1839258623, 1911698987, -37699356, -982013561, -1459018491, -883327242, 1252179801, -450105656, -799071091, -1118403434, -432827018, -2125877781, -1464392700, -1334310062, 1371610371, -1652853783, 2106513667, -1320908412, -1981687934, 1764341119, -457559919, -1414713643, -394200259, -1573937312, -1087220802, 1173327443, 1942963054, -1193483522, 575519546, 1411111401, -50696485, -390568655, -1496086086, -273047452, 1578846294, -1189987097, -366685926, -390542442, 310956635, 494216435, -1591836854, -1958561345, 2001630306, -1144004711, 942233085, -1824930634, -35558533, -1345162752, 1713162907, -600367835, -1294709678, -356747582, -761498023, -1171478393, -487172781, -1805861555, 1024219564, 579293477, 1140113838, -1419278172, 2024238092, -182420025, -1904591798, 2117082238, 1974281097, -1743267982, -919487101, -770400240, -1939219148, 1687214361, -543242059, 1687613177, 692025924, 1949554747, -1071587566, 216692383, -1231239857, -301100043, 1184608045, 1570062812, 1744165561, -2024511393, -2117292693, -183910117, -1210454800, 933754793, 1924478818, 1584015331, -1929400904, -1865280307, 589008399, -125964541, 1640238785, -1829002824, 1898736760, 2108532170, 1044726750, 1923261691, 1227983953, -1363934197, 384410393, -2044885611, 919914692, 736532642, -1239747894, -1632648707, 2134862632, 1386497909, -1028097404, -1390684557, 2139709518, -1273156420, 1222056809, 539391017, 515802054, -2129230707, -1408995398, 632880332, 1772504308, -966063115, -1799725714, 21937287, 1477165581, 1253744553, 203783501, 1236677003, 689872, 1075533786, 1649769611, -97814566, -337441085, 675577244, 1367391544, 1379603351, 1049700765, 847335499, -14567500, -118886754, 1563060129, -1287483713, 1574055369, -1513139721, -1389614002, -1144038162, 775868583, -606258386, -1987052516, 1855178673, -2044004547, -1581253380, 1201608055, 85619372, -68842748, -1279064480, 2005250983, -307341145, 1996142013, 375123593, -271055130, -1781860008, 1096813866, 1849745898, 1007707851, -1605275342, -2140441286, 739923250, -704377305, -467115791, 1079222860, 242615640, -1837178453, 318613241, 347811431, -197558611, -2019686765, -980556544, 1553348267, 494206472, 1112036812, 1258750298, -842445917, 1544265955, -1912564262, -620488471, -889282158, 1299296056, 423665295, 1359890860, 1077172953, -73273843, -1659840926, 1392617912, -1081530607, 1303291967, 392392088, -2017022783, 1184793512, -1869570613, -955858860, 340061913, 618379975, 1011823494, -809881216, 1816787957, 1978588983, -1138006003, 2078237231, 1842692073, -620524373, -1715977758, -939991847, 1418466514, 1620817717, 1901794668, -1390883660, 1843164580, 1743133853, 578558002, -1932993837, -858994155, -1461717196, 1528030456, 1435696692, -648559285, -302632139, -1607714348, 223376167, 1711779466, 317524838, -1082127435, -1990228258, -668408596, 548540297, 1651542945, -1614026445, -1832238632, -1037581785, -1523665978, 600270447, -574372648, -763786315, 283393782, 1770243570, -734407698, -1703285931, -327559973, -1788065014, 960709480, -1814854069, -908948374, -436117987, 1682085334, -762279866, -183191368, 220080184, -57766241, -676428704, 1598532481, -1255434042, 1989286800, -1717498989, 1784442077, -1337246483, 1458785475, -1332638305, 145755964, -1074151148, 1287376035, 1362332800, 224035916, -23479538, -1409046242, -694125069, -566762324, -630866531, -347269928, 679566165, 276545043, 366390502, 288394184, -1914964681, -1286440751, -2020552257, 1678295557, -443199195, -1935636633, 2101386234, 818513443, -708582396, 1983248498, -1871954656, -161206170, -1859668546, -1151541471, 988479706, -1460631101, 971904816, -1519785494, -1915212800, -1888967964, -1802228876, -1296777115, 1201309406, -1531584106, 826582647, 118055960, -1132107069, -373631934, -1371339394, -1940516137, 1127749479, 1201351105, 68476456, -1744193508, -306861080, -980025384, -2072230927, -1736978617, 1572698384, 1177367976, -1156123924, 775840687, -1727327625, -38219474, -2063183380, -1110362267, 1684813422, -884896557, 1016574566, 803377337, 540645732, -1240017080, -1178332843, 2034593037, 1429295941, 1034344725, 1381736146, -62446596, -833249209, 1611256781, -1200401518, -518501295, 1572749265, -807863775, -746688917, 1656148124, -1201074141, 922162158, 302308805, 2079850451, 1040750617, 2011035759, 1436256879, 344405547, 1340950393, 1207010603, 1972919535, -2062377130, -975191328, -973132685, -1556578693, 931702417, -1990261158, 35115389, -1650124362, 500851691, -1315688156) and \"em\".\"activity_id\" not in (-1961301967, 1409433884, -480772070, 253605083, -1464052776, -290906344, -1845071579, 1744461479, -1645028903, -990500766, 454426900, 1145100677, -1320427570, 1885478838, 1588799712, 1741583917) and \"em\".\"fuel_id\" in (193009920, 759960937, 2035346998, -1759484656, -830241899, 23822128, -1163760912, -1660819109, 2066942576, 1898049943, 1484267897, -248609480, -1358379524, 347520938, 1385935766, -1049358887, 1587660764, -784501144, -2085768558, -1454921658, -762418863, -83169964, 2074953191, -704599906, -796112667, -1598383649, -2102937339, -683447095, 203685376, -1105469274, 1344636899, -1909685346, 1084264565, 1554441156, 281177182, -1906149501, 1615206468, -1616434285, 1194464230, -485896727, 1078099193, 1884553775, 1992193200, 1908804281, 842100943, 237320038, 1506772054, 78930848, -821358327, 1625357355, 16034538, 1801451108, -791711088, -601886031, -1592428522, 454816236, 48365780, 625058658, -1104883769, 1567694641, 1625866553, -1415973785, 512871173, -604367190, 13585771, 1914704207, 915693911, -2117240436, -68749161, -1294566295, 783920659, -52796417, 634974096, 556720288, -825344667, 208303479, -1668675215, -1994671959, 1875270378, 1488087421, 745451612, -1951840467, -267083638, 606829677, -664757232, -1068765758, 1611197846, -1673725551, -874737624, 1495275359, 1710276699, -1920227806, -202464622, 480850863, -1782263122, -1594592327, 566015977, -1912882661, 1855338849, -635957407, 1685905379, 618715071, -59538796, 1285184399, -507988172, 767873144, -1115210332, 1177006962, 609723321, -2111800721, 612491118, 1544538872, 521156911, -1272684724, -531598568, 221388039, 580937015, -1174609830, 1330229813, -1809684072) group by \"em\".\"year_id\", \"territoire_parent\", \"territoire\", \"activite\", \"combustible\""} 
[2026-08-06 13:09:43] local.DEBUG: ProductionQueryBuilder {"context":"App\\Services\\Inventaire\\{closure}","mode":"fact","source_table":"observatoire.fact_production","filter_level":"epci","display_level":null,"years":[2024,2023,2022,2021,2020,2019,2018,2017,2016,2015,2014,2012,2010,2005,1990],"sql":"select fp.year_id, COALESCE(t.name, '(non rattaché)') AS territoire, COALESCE(fi.name, '(non rattaché)') AS filiere_parent, COALESCE(fi_display.name, '(non rattaché)') AS filiere, 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 (-1166465414)) as communes inner join \"observatoire\".\"fact_production\" as \"fp\" on \"fp\".\"geo_id\" = \"communes\".\"territory_id\" and \"fp\".\"year_id\" in (2024, 2023, 2022, 2021, 2020, 2019, 2018, 2017, 2016, 2015, 2014, 2012, 2010, 2005, 1990) left join \"observatoire\".\"dim_territory_memberships\" as \"dtm_d\" on \"dtm_d\".\"territory_id\" = \"fp\".\"geo_id\" and \"dtm_d\".\"parent_id\" in (-1166465414) 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 (1422694530, 315631697) inner join \"observatoire\".\"dim_filieres\" as \"fi\" on \"fi\".\"id\" = \"dtm_fi\".\"parent_id\" inner join \"observatoire\".\"dim_filiere_memberships\" as \"dtm_fi_display\" on \"dtm_fi_display\".\"filiere_id\" = \"fp\".\"filiere_id\" inner join \"observatoire\".\"dim_filieres\" as \"fi_display\" on \"fi_display\".\"id\" = \"dtm_fi_display\".\"parent_id\" and \"fi_display\".\"type_id\" = 'filiere_detail_externe' inner join \"observatoire\".\"dim_vecteurs\" as \"v\" on \"v\".\"id\" = \"fp\".\"vecteur_id\" where \"fp\".\"filiere_id\" in (-1993658124, -1982952820, -1960216134, -1958549795, -1936754040, -1844241335, -1839941303, -1773246028, -1520867241, -1312393098, -1165502792, -1004992653, -996979377, -992312423, -929314708, -498981429, -318804108, 144162739, 513682483, 753002958, 774281089, 874142471, 1200710728, 1340024063, 1371856852, 1453260670, 1489167039, 1498175839, 1506126584, 1723321957, 1764268061, 1852304876, 1961061561, 1963506075) and \"fp\".\"vecteur_id\" in (3, 2, 1) 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_parent\", \"filiere\", \"v\".\"name\""} 
[2026-08-06 13:09:44] local.DEBUG: ProductionQueryBuilder {"context":"App\\Services\\Inventaire\\{closure}","mode":"fact","source_table":"observatoire.fact_production","filter_level":"epci","display_level":null,"years":[2024,2023,2022,2021,2020,2019,2018,2017,2016,2015,2014,2012,2010,2005,1990],"sql":"select fp.year_id, COALESCE(t.name, '(non rattaché)') AS territoire, COALESCE(fi.name, '(non rattaché)') AS filiere_parent, COALESCE(fi_display.name, '(non rattaché)') AS filiere, 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 (-1166465414)) as communes inner join \"observatoire\".\"fact_production\" as \"fp\" on \"fp\".\"geo_id\" = \"communes\".\"territory_id\" and \"fp\".\"year_id\" in (2024, 2023, 2022, 2021, 2020, 2019, 2018, 2017, 2016, 2015, 2014, 2012, 2010, 2005, 1990) left join \"observatoire\".\"dim_territory_memberships\" as \"dtm_d\" on \"dtm_d\".\"territory_id\" = \"fp\".\"geo_id\" and \"dtm_d\".\"parent_id\" in (-1166465414) 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 (1422694530, 315631697) inner join \"observatoire\".\"dim_filieres\" as \"fi\" on \"fi\".\"id\" = \"dtm_fi\".\"parent_id\" inner join \"observatoire\".\"dim_filiere_memberships\" as \"dtm_fi_display\" on \"dtm_fi_display\".\"filiere_id\" = \"fp\".\"filiere_id\" inner join \"observatoire\".\"dim_filieres\" as \"fi_display\" on \"fi_display\".\"id\" = \"dtm_fi_display\".\"parent_id\" and \"fi_display\".\"type_id\" = 'filiere_detail_externe' inner join \"observatoire\".\"dim_vecteurs\" as \"v\" on \"v\".\"id\" = \"fp\".\"vecteur_id\" where \"fp\".\"filiere_id\" in (-1993658124, -1982952820, -1960216134, -1958549795, -1936754040, -1844241335, -1839941303, -1773246028, -1520867241, -1312393098, -1165502792, -1004992653, -996979377, -992312423, -929314708, -498981429, -318804108, 144162739, 513682483, 753002958, 774281089, 874142471, 1200710728, 1340024063, 1371856852, 1453260670, 1489167039, 1498175839, 1506126584, 1723321957, 1764268061, 1852304876, 1961061561, 1963506075) and \"fp\".\"vecteur_id\" in (3, 2, 1) 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_parent\", \"filiere\", \"v\".\"name\""} 
[2026-08-06 13:09:49] local.DEBUG: ProductionQueryBuilder {"context":"App\\Services\\Inventaire\\{closure}","mode":"fact","source_table":"observatoire.fact_production","filter_level":"epci","display_level":null,"years":[2024,2023,2022,2021,2020,2019,2018,2017,2016,2015,2014,2012,2010,2005,1990],"sql":"select fp.year_id, COALESCE(t.name, '(non rattaché)') AS territoire, COALESCE(fi.name, '(non rattaché)') AS filiere_parent, COALESCE(fi_display.name, '(non rattaché)') AS filiere, 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 (-1166465414)) as communes inner join \"observatoire\".\"fact_production\" as \"fp\" on \"fp\".\"geo_id\" = \"communes\".\"territory_id\" and \"fp\".\"year_id\" in (2024, 2023, 2022, 2021, 2020, 2019, 2018, 2017, 2016, 2015, 2014, 2012, 2010, 2005, 1990) left join \"observatoire\".\"dim_territory_memberships\" as \"dtm_d\" on \"dtm_d\".\"territory_id\" = \"fp\".\"geo_id\" and \"dtm_d\".\"parent_id\" in (-1166465414) 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 (1422694530, 315631697) inner join \"observatoire\".\"dim_filieres\" as \"fi\" on \"fi\".\"id\" = \"dtm_fi\".\"parent_id\" inner join \"observatoire\".\"dim_filiere_memberships\" as \"dtm_fi_display\" on \"dtm_fi_display\".\"filiere_id\" = \"fp\".\"filiere_id\" inner join \"observatoire\".\"dim_filieres\" as \"fi_display\" on \"fi_display\".\"id\" = \"dtm_fi_display\".\"parent_id\" and \"fi_display\".\"type_id\" = 'filiere_detail_externe' inner join \"observatoire\".\"dim_vecteurs\" as \"v\" on \"v\".\"id\" = \"fp\".\"vecteur_id\" where \"fp\".\"filiere_id\" in (-1993658124, -1982952820, -1960216134, -1958549795, -1936754040, -1844241335, -1839941303, -1773246028, -1520867241, -1312393098, -1165502792, -1004992653, -996979377, -992312423, -929314708, -498981429, -318804108, 144162739, 513682483, 753002958, 774281089, 874142471, 1200710728, 1340024063, 1371856852, 1453260670, 1489167039, 1498175839, 1506126584, 1723321957, 1764268061, 1852304876, 1961061561, 1963506075) and \"fp\".\"vecteur_id\" in (3, 2, 1) 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_parent\", \"filiere\", \"v\".\"name\""} 
[2026-08-06 13:20:26] local.DEBUG: FactureEnergetiqueQuery {"years":[2024],"filter_geo_ids":[-330926110],"top_n":5,"sql":"select \"result\".\"territoire_id\", COALESCE(t.name, '(non rattaché)') AS territoire, \"result\".\"year_id\", \"result\".\"id_type_comptable\", \"result\".\"rang\", \"result\".\"montant_euros\", \"result\".\"contribution\", CASE WHEN result.id_type_comptable = 1 THEN 'Dépenses' WHEN result.id_type_comptable = 2 THEN 'Recettes' WHEN result.id_type_comptable = 3 THEN 'Facture nette globale' WHEN result.id_type_comptable = 4 THEN 'Facture nette globale/hab' END AS type_comptable, CASE WHEN result.rang = 0 AND result.id_type_comptable = 1 THEN 'Dépense totale' WHEN result.rang = 0 AND result.id_type_comptable = 2 THEN 'Recette totale' WHEN result.id_type_comptable = 3 THEN 'Facture nette globale' WHEN result.id_type_comptable = 4 THEN 'Facture nette globale/hab' WHEN result.id_type_comptable = 1 THEN COALESCE(a.name, '') || ' - ' || COALESCE(fc.name, '') WHEN result.id_type_comptable = 2 THEN COALESCE(fdi.name, '') || ' - ' || COALESCE(v.name, '') END AS poste from ((select territoire_id, year_id, 1 AS id_type_comptable, poste_energetique_id, rang, montant_euros, contribution from (select a.territoire_id, a.year_id, a.poste_energetique_id, RANK() OVER (PARTITION BY a.territoire_id, a.year_id ORDER BY a.montant_euros DESC) AS rang, a.montant_euros, ROUND((a.montant_euros / t.montant_euros * 100)::numeric, 2) AS contribution from (select \"dtm\".\"parent_id\" as \"territoire_id\", \"f\".\"year_id\", \"dpe\".\"id\" as \"poste_energetique_id\", SUM(f.montant_euros) as montant_euros from \"observatoire\".\"fact_depense_conso_energetique\" as \"f\" inner join \"observatoire\".\"dim_territory_memberships\" as \"dtm\" on \"dtm\".\"territory_id\" = \"f\".\"geo_id\" inner join \"observatoire\".\"dim_postes_energetique\" as \"dpe\" on \"dpe\".\"id_type_comptable\" = 1 and \"dpe\".\"activity_id\" = \"f\".\"activity_id\" and \"dpe\".\"fuel_cat_id\" = \"f\".\"fuel_cat_id\" where \"dtm\".\"parent_id\" in (-330926110) and \"f\".\"year_id\" in (2024) group by \"dtm\".\"parent_id\", \"f\".\"year_id\", \"dpe\".\"id\") as \"a\" inner join (select \"territoire_id\", \"year_id\", SUM(montant_euros) as montant_euros from (select \"dtm\".\"parent_id\" as \"territoire_id\", \"f\".\"year_id\", \"dpe\".\"id\" as \"poste_energetique_id\", SUM(f.montant_euros) as montant_euros from \"observatoire\".\"fact_depense_conso_energetique\" as \"f\" inner join \"observatoire\".\"dim_territory_memberships\" as \"dtm\" on \"dtm\".\"territory_id\" = \"f\".\"geo_id\" inner join \"observatoire\".\"dim_postes_energetique\" as \"dpe\" on \"dpe\".\"id_type_comptable\" = 1 and \"dpe\".\"activity_id\" = \"f\".\"activity_id\" and \"dpe\".\"fuel_cat_id\" = \"f\".\"fuel_cat_id\" where \"dtm\".\"parent_id\" in (-330926110) and \"f\".\"year_id\" in (2024) group by \"dtm\".\"parent_id\", \"f\".\"year_id\", \"dpe\".\"id\") as \"agg\" group by \"territoire_id\", \"year_id\") as \"t\" on \"t\".\"territoire_id\" = \"a\".\"territoire_id\" and \"t\".\"year_id\" = \"a\".\"year_id\") as \"ranked\" where \"rang\" <= 5) union all (select territoire_id, year_id, 1 AS id_type_comptable, NULL::integer AS poste_energetique_id, 0::bigint AS rang, montant_euros, 100::numeric AS contribution from (select \"territoire_id\", \"year_id\", SUM(montant_euros) as montant_euros from (select \"dtm\".\"parent_id\" as \"territoire_id\", \"f\".\"year_id\", \"dpe\".\"id\" as \"poste_energetique_id\", SUM(f.montant_euros) as montant_euros from \"observatoire\".\"fact_depense_conso_energetique\" as \"f\" inner join \"observatoire\".\"dim_territory_memberships\" as \"dtm\" on \"dtm\".\"territory_id\" = \"f\".\"geo_id\" inner join \"observatoire\".\"dim_postes_energetique\" as \"dpe\" on \"dpe\".\"id_type_comptable\" = 1 and \"dpe\".\"activity_id\" = \"f\".\"activity_id\" and \"dpe\".\"fuel_cat_id\" = \"f\".\"fuel_cat_id\" where \"dtm\".\"parent_id\" in (-330926110) and \"f\".\"year_id\" in (2024) group by \"dtm\".\"parent_id\", \"f\".\"year_id\", \"dpe\".\"id\") as \"agg\" group by \"territoire_id\", \"year_id\") as \"agg\") union all (select territoire_id, year_id, 2 AS id_type_comptable, poste_energetique_id, rang, montant_euros, contribution from (select a.territoire_id, a.year_id, a.poste_energetique_id, RANK() OVER (PARTITION BY a.territoire_id, a.year_id ORDER BY a.montant_euros DESC) AS rang, a.montant_euros, ROUND((a.montant_euros / t.montant_euros * 100)::numeric, 2) AS contribution from (select \"dtm\".\"parent_id\" as \"territoire_id\", \"f\".\"year_id\", \"dpe\".\"id\" as \"poste_energetique_id\", SUM(f.montant_euros) as montant_euros from \"observatoire\".\"fact_recette_prod_energetique\" as \"f\" inner join \"observatoire\".\"dim_territory_memberships\" as \"dtm\" on \"dtm\".\"territory_id\" = \"f\".\"geo_id\" inner join \"observatoire\".\"dim_postes_energetique\" as \"dpe\" on \"dpe\".\"id_type_comptable\" = 2 and \"dpe\".\"filiere_detail_interne_id\" = \"f\".\"filiere_detail_interne_id\" and \"dpe\".\"vecteur_id\" = \"f\".\"vecteur_id\" where \"dtm\".\"parent_id\" in (-330926110) and \"f\".\"year_id\" in (2024) group by \"dtm\".\"parent_id\", \"f\".\"year_id\", \"dpe\".\"id\") as \"a\" inner join (select \"territoire_id\", \"year_id\", SUM(montant_euros) as montant_euros from (select \"dtm\".\"parent_id\" as \"territoire_id\", \"f\".\"year_id\", \"dpe\".\"id\" as \"poste_energetique_id\", SUM(f.montant_euros) as montant_euros from \"observatoire\".\"fact_recette_prod_energetique\" as \"f\" inner join \"observatoire\".\"dim_territory_memberships\" as \"dtm\" on \"dtm\".\"territory_id\" = \"f\".\"geo_id\" inner join \"observatoire\".\"dim_postes_energetique\" as \"dpe\" on \"dpe\".\"id_type_comptable\" = 2 and \"dpe\".\"filiere_detail_interne_id\" = \"f\".\"filiere_detail_interne_id\" and \"dpe\".\"vecteur_id\" = \"f\".\"vecteur_id\" where \"dtm\".\"parent_id\" in (-330926110) and \"f\".\"year_id\" in (2024) group by \"dtm\".\"parent_id\", \"f\".\"year_id\", \"dpe\".\"id\") as \"agg\" group by \"territoire_id\", \"year_id\") as \"t\" on \"t\".\"territoire_id\" = \"a\".\"territoire_id\" and \"t\".\"year_id\" = \"a\".\"year_id\") as \"ranked\" where \"rang\" <= 5) union all (select territoire_id, year_id, 2 AS id_type_comptable, NULL::integer AS poste_energetique_id, 0::bigint AS rang, montant_euros, 100::numeric AS contribution from (select \"territoire_id\", \"year_id\", SUM(montant_euros) as montant_euros from (select \"dtm\".\"parent_id\" as \"territoire_id\", \"f\".\"year_id\", \"dpe\".\"id\" as \"poste_energetique_id\", SUM(f.montant_euros) as montant_euros from \"observatoire\".\"fact_recette_prod_energetique\" as \"f\" inner join \"observatoire\".\"dim_territory_memberships\" as \"dtm\" on \"dtm\".\"territory_id\" = \"f\".\"geo_id\" inner join \"observatoire\".\"dim_postes_energetique\" as \"dpe\" on \"dpe\".\"id_type_comptable\" = 2 and \"dpe\".\"filiere_detail_interne_id\" = \"f\".\"filiere_detail_interne_id\" and \"dpe\".\"vecteur_id\" = \"f\".\"vecteur_id\" where \"dtm\".\"parent_id\" in (-330926110) and \"f\".\"year_id\" in (2024) group by \"dtm\".\"parent_id\", \"f\".\"year_id\", \"dpe\".\"id\") as \"agg\" group by \"territoire_id\", \"year_id\") as \"agg\") union all (select territoire_id, year_id, 3 AS id_type_comptable, NULL::integer AS poste_energetique_id, NULL::bigint AS rang, ABS(montant_euros) AS montant_euros, NULL::numeric AS contribution from (select \"dt\".\"territoire_id\", \"dt\".\"year_id\", (rt.montant_euros - dt.montant_euros) as montant_euros from (select \"territoire_id\", \"year_id\", SUM(montant_euros) as montant_euros from (select \"dtm\".\"parent_id\" as \"territoire_id\", \"f\".\"year_id\", \"dpe\".\"id\" as \"poste_energetique_id\", SUM(f.montant_euros) as montant_euros from \"observatoire\".\"fact_depense_conso_energetique\" as \"f\" inner join \"observatoire\".\"dim_territory_memberships\" as \"dtm\" on \"dtm\".\"territory_id\" = \"f\".\"geo_id\" inner join \"observatoire\".\"dim_postes_energetique\" as \"dpe\" on \"dpe\".\"id_type_comptable\" = 1 and \"dpe\".\"activity_id\" = \"f\".\"activity_id\" and \"dpe\".\"fuel_cat_id\" = \"f\".\"fuel_cat_id\" where \"dtm\".\"parent_id\" in (-330926110) and \"f\".\"year_id\" in (2024) group by \"dtm\".\"parent_id\", \"f\".\"year_id\", \"dpe\".\"id\") as \"agg\" group by \"territoire_id\", \"year_id\") as \"dt\" inner join (select \"territoire_id\", \"year_id\", SUM(montant_euros) as montant_euros from (select \"dtm\".\"parent_id\" as \"territoire_id\", \"f\".\"year_id\", \"dpe\".\"id\" as \"poste_energetique_id\", SUM(f.montant_euros) as montant_euros from \"observatoire\".\"fact_recette_prod_energetique\" as \"f\" inner join \"observatoire\".\"dim_territory_memberships\" as \"dtm\" on \"dtm\".\"territory_id\" = \"f\".\"geo_id\" inner join \"observatoire\".\"dim_postes_energetique\" as \"dpe\" on \"dpe\".\"id_type_comptable\" = 2 and \"dpe\".\"filiere_detail_interne_id\" = \"f\".\"filiere_detail_interne_id\" and \"dpe\".\"vecteur_id\" = \"f\".\"vecteur_id\" where \"dtm\".\"parent_id\" in (-330926110) and \"f\".\"year_id\" in (2024) group by \"dtm\".\"parent_id\", \"f\".\"year_id\", \"dpe\".\"id\") as \"agg\" group by \"territoire_id\", \"year_id\") as \"rt\" on \"rt\".\"territoire_id\" = \"dt\".\"territoire_id\" and \"rt\".\"year_id\" = \"dt\".\"year_id\") as \"fg\") union all (select fg.territoire_id, fg.year_id, 4 AS id_type_comptable, NULL::integer AS poste_energetique_id, NULL::bigint AS rang, ROUND((ABS(fg.montant_euros) / pa.population)::numeric, 2) AS montant_euros, NULL::numeric AS contribution from (select \"dt\".\"territoire_id\", \"dt\".\"year_id\", (rt.montant_euros - dt.montant_euros) as montant_euros from (select \"territoire_id\", \"year_id\", SUM(montant_euros) as montant_euros from (select \"dtm\".\"parent_id\" as \"territoire_id\", \"f\".\"year_id\", \"dpe\".\"id\" as \"poste_energetique_id\", SUM(f.montant_euros) as montant_euros from \"observatoire\".\"fact_depense_conso_energetique\" as \"f\" inner join \"observatoire\".\"dim_territory_memberships\" as \"dtm\" on \"dtm\".\"territory_id\" = \"f\".\"geo_id\" inner join \"observatoire\".\"dim_postes_energetique\" as \"dpe\" on \"dpe\".\"id_type_comptable\" = 1 and \"dpe\".\"activity_id\" = \"f\".\"activity_id\" and \"dpe\".\"fuel_cat_id\" = \"f\".\"fuel_cat_id\" where \"dtm\".\"parent_id\" in (-330926110) and \"f\".\"year_id\" in (2024) group by \"dtm\".\"parent_id\", \"f\".\"year_id\", \"dpe\".\"id\") as \"agg\" group by \"territoire_id\", \"year_id\") as \"dt\" inner join (select \"territoire_id\", \"year_id\", SUM(montant_euros) as montant_euros from (select \"dtm\".\"parent_id\" as \"territoire_id\", \"f\".\"year_id\", \"dpe\".\"id\" as \"poste_energetique_id\", SUM(f.montant_euros) as montant_euros from \"observatoire\".\"fact_recette_prod_energetique\" as \"f\" inner join \"observatoire\".\"dim_territory_memberships\" as \"dtm\" on \"dtm\".\"territory_id\" = \"f\".\"geo_id\" inner join \"observatoire\".\"dim_postes_energetique\" as \"dpe\" on \"dpe\".\"id_type_comptable\" = 2 and \"dpe\".\"filiere_detail_interne_id\" = \"f\".\"filiere_detail_interne_id\" and \"dpe\".\"vecteur_id\" = \"f\".\"vecteur_id\" where \"dtm\".\"parent_id\" in (-330926110) and \"f\".\"year_id\" in (2024) group by \"dtm\".\"parent_id\", \"f\".\"year_id\", \"dpe\".\"id\") as \"agg\" group by \"territoire_id\", \"year_id\") as \"rt\" on \"rt\".\"territoire_id\" = \"dt\".\"territoire_id\" and \"rt\".\"year_id\" = \"dt\".\"year_id\") as \"fg\" inner join (select \"dtm\".\"parent_id\" as \"territoire_id\", \"fp\".\"year_id\", SUM(fp.population) as population from \"observatoire\".\"fact_population\" as \"fp\" inner join \"observatoire\".\"dim_territory_memberships\" as \"dtm\" on \"dtm\".\"territory_id\" = \"fp\".\"geo_id\" where \"dtm\".\"parent_id\" in (-330926110) and \"fp\".\"year_id\" in (2024) group by \"dtm\".\"parent_id\", \"fp\".\"year_id\") as \"pa\" on \"pa\".\"territoire_id\" = \"fg\".\"territoire_id\" and \"pa\".\"year_id\" = \"fg\".\"year_id\")) as \"result\" left join \"observatoire\".\"dim_territories\" as \"t\" on \"t\".\"id\" = \"result\".\"territoire_id\" left join \"observatoire\".\"dim_postes_energetique\" as \"dpe\" on \"dpe\".\"id\" = \"result\".\"poste_energetique_id\" left join \"observatoire\".\"dim_activities\" as \"a\" on \"a\".\"id\" = \"dpe\".\"activity_id\" left join \"observatoire\".\"dim_fuels\" as \"fc\" on \"fc\".\"id\" = \"dpe\".\"fuel_cat_id\" left join \"observatoire\".\"dim_filieres\" as \"fdi\" on \"fdi\".\"id\" = \"dpe\".\"filiere_detail_interne_id\" left join \"observatoire\".\"dim_vecteurs\" as \"v\" on \"v\".\"id\" = \"dpe\".\"vecteur_id\""} 
[2026-08-06 13:20:27] local.DEBUG: FactureEnergetiqueQuery {"years":[2024],"filter_geo_ids":[-330926110],"top_n":5,"sql":"select \"result\".\"territoire_id\", COALESCE(t.name, '(non rattaché)') AS territoire, \"result\".\"year_id\", \"result\".\"id_type_comptable\", \"result\".\"rang\", \"result\".\"montant_euros\", \"result\".\"contribution\", CASE WHEN result.id_type_comptable = 1 THEN 'Dépenses' WHEN result.id_type_comptable = 2 THEN 'Recettes' WHEN result.id_type_comptable = 3 THEN 'Facture nette globale' WHEN result.id_type_comptable = 4 THEN 'Facture nette globale/hab' END AS type_comptable, CASE WHEN result.rang = 0 AND result.id_type_comptable = 1 THEN 'Dépense totale' WHEN result.rang = 0 AND result.id_type_comptable = 2 THEN 'Recette totale' WHEN result.id_type_comptable = 3 THEN 'Facture nette globale' WHEN result.id_type_comptable = 4 THEN 'Facture nette globale/hab' WHEN result.id_type_comptable = 1 THEN COALESCE(a.name, '') || ' - ' || COALESCE(fc.name, '') WHEN result.id_type_comptable = 2 THEN COALESCE(fdi.name, '') || ' - ' || COALESCE(v.name, '') END AS poste from ((select territoire_id, year_id, 1 AS id_type_comptable, poste_energetique_id, rang, montant_euros, contribution from (select a.territoire_id, a.year_id, a.poste_energetique_id, RANK() OVER (PARTITION BY a.territoire_id, a.year_id ORDER BY a.montant_euros DESC) AS rang, a.montant_euros, ROUND((a.montant_euros / t.montant_euros * 100)::numeric, 2) AS contribution from (select \"dtm\".\"parent_id\" as \"territoire_id\", \"f\".\"year_id\", \"dpe\".\"id\" as \"poste_energetique_id\", SUM(f.montant_euros) as montant_euros from \"observatoire\".\"fact_depense_conso_energetique\" as \"f\" inner join \"observatoire\".\"dim_territory_memberships\" as \"dtm\" on \"dtm\".\"territory_id\" = \"f\".\"geo_id\" inner join \"observatoire\".\"dim_postes_energetique\" as \"dpe\" on \"dpe\".\"id_type_comptable\" = 1 and \"dpe\".\"activity_id\" = \"f\".\"activity_id\" and \"dpe\".\"fuel_cat_id\" = \"f\".\"fuel_cat_id\" where \"dtm\".\"parent_id\" in (-330926110) and \"f\".\"year_id\" in (2024) group by \"dtm\".\"parent_id\", \"f\".\"year_id\", \"dpe\".\"id\") as \"a\" inner join (select \"territoire_id\", \"year_id\", SUM(montant_euros) as montant_euros from (select \"dtm\".\"parent_id\" as \"territoire_id\", \"f\".\"year_id\", \"dpe\".\"id\" as \"poste_energetique_id\", SUM(f.montant_euros) as montant_euros from \"observatoire\".\"fact_depense_conso_energetique\" as \"f\" inner join \"observatoire\".\"dim_territory_memberships\" as \"dtm\" on \"dtm\".\"territory_id\" = \"f\".\"geo_id\" inner join \"observatoire\".\"dim_postes_energetique\" as \"dpe\" on \"dpe\".\"id_type_comptable\" = 1 and \"dpe\".\"activity_id\" = \"f\".\"activity_id\" and \"dpe\".\"fuel_cat_id\" = \"f\".\"fuel_cat_id\" where \"dtm\".\"parent_id\" in (-330926110) and \"f\".\"year_id\" in (2024) group by \"dtm\".\"parent_id\", \"f\".\"year_id\", \"dpe\".\"id\") as \"agg\" group by \"territoire_id\", \"year_id\") as \"t\" on \"t\".\"territoire_id\" = \"a\".\"territoire_id\" and \"t\".\"year_id\" = \"a\".\"year_id\") as \"ranked\" where \"rang\" <= 5) union all (select territoire_id, year_id, 1 AS id_type_comptable, NULL::integer AS poste_energetique_id, 0::bigint AS rang, montant_euros, 100::numeric AS contribution from (select \"territoire_id\", \"year_id\", SUM(montant_euros) as montant_euros from (select \"dtm\".\"parent_id\" as \"territoire_id\", \"f\".\"year_id\", \"dpe\".\"id\" as \"poste_energetique_id\", SUM(f.montant_euros) as montant_euros from \"observatoire\".\"fact_depense_conso_energetique\" as \"f\" inner join \"observatoire\".\"dim_territory_memberships\" as \"dtm\" on \"dtm\".\"territory_id\" = \"f\".\"geo_id\" inner join \"observatoire\".\"dim_postes_energetique\" as \"dpe\" on \"dpe\".\"id_type_comptable\" = 1 and \"dpe\".\"activity_id\" = \"f\".\"activity_id\" and \"dpe\".\"fuel_cat_id\" = \"f\".\"fuel_cat_id\" where \"dtm\".\"parent_id\" in (-330926110) and \"f\".\"year_id\" in (2024) group by \"dtm\".\"parent_id\", \"f\".\"year_id\", \"dpe\".\"id\") as \"agg\" group by \"territoire_id\", \"year_id\") as \"agg\") union all (select territoire_id, year_id, 2 AS id_type_comptable, poste_energetique_id, rang, montant_euros, contribution from (select a.territoire_id, a.year_id, a.poste_energetique_id, RANK() OVER (PARTITION BY a.territoire_id, a.year_id ORDER BY a.montant_euros DESC) AS rang, a.montant_euros, ROUND((a.montant_euros / t.montant_euros * 100)::numeric, 2) AS contribution from (select \"dtm\".\"parent_id\" as \"territoire_id\", \"f\".\"year_id\", \"dpe\".\"id\" as \"poste_energetique_id\", SUM(f.montant_euros) as montant_euros from \"observatoire\".\"fact_recette_prod_energetique\" as \"f\" inner join \"observatoire\".\"dim_territory_memberships\" as \"dtm\" on \"dtm\".\"territory_id\" = \"f\".\"geo_id\" inner join \"observatoire\".\"dim_postes_energetique\" as \"dpe\" on \"dpe\".\"id_type_comptable\" = 2 and \"dpe\".\"filiere_detail_interne_id\" = \"f\".\"filiere_detail_interne_id\" and \"dpe\".\"vecteur_id\" = \"f\".\"vecteur_id\" where \"dtm\".\"parent_id\" in (-330926110) and \"f\".\"year_id\" in (2024) group by \"dtm\".\"parent_id\", \"f\".\"year_id\", \"dpe\".\"id\") as \"a\" inner join (select \"territoire_id\", \"year_id\", SUM(montant_euros) as montant_euros from (select \"dtm\".\"parent_id\" as \"territoire_id\", \"f\".\"year_id\", \"dpe\".\"id\" as \"poste_energetique_id\", SUM(f.montant_euros) as montant_euros from \"observatoire\".\"fact_recette_prod_energetique\" as \"f\" inner join \"observatoire\".\"dim_territory_memberships\" as \"dtm\" on \"dtm\".\"territory_id\" = \"f\".\"geo_id\" inner join \"observatoire\".\"dim_postes_energetique\" as \"dpe\" on \"dpe\".\"id_type_comptable\" = 2 and \"dpe\".\"filiere_detail_interne_id\" = \"f\".\"filiere_detail_interne_id\" and \"dpe\".\"vecteur_id\" = \"f\".\"vecteur_id\" where \"dtm\".\"parent_id\" in (-330926110) and \"f\".\"year_id\" in (2024) group by \"dtm\".\"parent_id\", \"f\".\"year_id\", \"dpe\".\"id\") as \"agg\" group by \"territoire_id\", \"year_id\") as \"t\" on \"t\".\"territoire_id\" = \"a\".\"territoire_id\" and \"t\".\"year_id\" = \"a\".\"year_id\") as \"ranked\" where \"rang\" <= 5) union all (select territoire_id, year_id, 2 AS id_type_comptable, NULL::integer AS poste_energetique_id, 0::bigint AS rang, montant_euros, 100::numeric AS contribution from (select \"territoire_id\", \"year_id\", SUM(montant_euros) as montant_euros from (select \"dtm\".\"parent_id\" as \"territoire_id\", \"f\".\"year_id\", \"dpe\".\"id\" as \"poste_energetique_id\", SUM(f.montant_euros) as montant_euros from \"observatoire\".\"fact_recette_prod_energetique\" as \"f\" inner join \"observatoire\".\"dim_territory_memberships\" as \"dtm\" on \"dtm\".\"territory_id\" = \"f\".\"geo_id\" inner join \"observatoire\".\"dim_postes_energetique\" as \"dpe\" on \"dpe\".\"id_type_comptable\" = 2 and \"dpe\".\"filiere_detail_interne_id\" = \"f\".\"filiere_detail_interne_id\" and \"dpe\".\"vecteur_id\" = \"f\".\"vecteur_id\" where \"dtm\".\"parent_id\" in (-330926110) and \"f\".\"year_id\" in (2024) group by \"dtm\".\"parent_id\", \"f\".\"year_id\", \"dpe\".\"id\") as \"agg\" group by \"territoire_id\", \"year_id\") as \"agg\") union all (select territoire_id, year_id, 3 AS id_type_comptable, NULL::integer AS poste_energetique_id, NULL::bigint AS rang, ABS(montant_euros) AS montant_euros, NULL::numeric AS contribution from (select \"dt\".\"territoire_id\", \"dt\".\"year_id\", (rt.montant_euros - dt.montant_euros) as montant_euros from (select \"territoire_id\", \"year_id\", SUM(montant_euros) as montant_euros from (select \"dtm\".\"parent_id\" as \"territoire_id\", \"f\".\"year_id\", \"dpe\".\"id\" as \"poste_energetique_id\", SUM(f.montant_euros) as montant_euros from \"observatoire\".\"fact_depense_conso_energetique\" as \"f\" inner join \"observatoire\".\"dim_territory_memberships\" as \"dtm\" on \"dtm\".\"territory_id\" = \"f\".\"geo_id\" inner join \"observatoire\".\"dim_postes_energetique\" as \"dpe\" on \"dpe\".\"id_type_comptable\" = 1 and \"dpe\".\"activity_id\" = \"f\".\"activity_id\" and \"dpe\".\"fuel_cat_id\" = \"f\".\"fuel_cat_id\" where \"dtm\".\"parent_id\" in (-330926110) and \"f\".\"year_id\" in (2024) group by \"dtm\".\"parent_id\", \"f\".\"year_id\", \"dpe\".\"id\") as \"agg\" group by \"territoire_id\", \"year_id\") as \"dt\" inner join (select \"territoire_id\", \"year_id\", SUM(montant_euros) as montant_euros from (select \"dtm\".\"parent_id\" as \"territoire_id\", \"f\".\"year_id\", \"dpe\".\"id\" as \"poste_energetique_id\", SUM(f.montant_euros) as montant_euros from \"observatoire\".\"fact_recette_prod_energetique\" as \"f\" inner join \"observatoire\".\"dim_territory_memberships\" as \"dtm\" on \"dtm\".\"territory_id\" = \"f\".\"geo_id\" inner join \"observatoire\".\"dim_postes_energetique\" as \"dpe\" on \"dpe\".\"id_type_comptable\" = 2 and \"dpe\".\"filiere_detail_interne_id\" = \"f\".\"filiere_detail_interne_id\" and \"dpe\".\"vecteur_id\" = \"f\".\"vecteur_id\" where \"dtm\".\"parent_id\" in (-330926110) and \"f\".\"year_id\" in (2024) group by \"dtm\".\"parent_id\", \"f\".\"year_id\", \"dpe\".\"id\") as \"agg\" group by \"territoire_id\", \"year_id\") as \"rt\" on \"rt\".\"territoire_id\" = \"dt\".\"territoire_id\" and \"rt\".\"year_id\" = \"dt\".\"year_id\") as \"fg\") union all (select fg.territoire_id, fg.year_id, 4 AS id_type_comptable, NULL::integer AS poste_energetique_id, NULL::bigint AS rang, ROUND((ABS(fg.montant_euros) / pa.population)::numeric, 2) AS montant_euros, NULL::numeric AS contribution from (select \"dt\".\"territoire_id\", \"dt\".\"year_id\", (rt.montant_euros - dt.montant_euros) as montant_euros from (select \"territoire_id\", \"year_id\", SUM(montant_euros) as montant_euros from (select \"dtm\".\"parent_id\" as \"territoire_id\", \"f\".\"year_id\", \"dpe\".\"id\" as \"poste_energetique_id\", SUM(f.montant_euros) as montant_euros from \"observatoire\".\"fact_depense_conso_energetique\" as \"f\" inner join \"observatoire\".\"dim_territory_memberships\" as \"dtm\" on \"dtm\".\"territory_id\" = \"f\".\"geo_id\" inner join \"observatoire\".\"dim_postes_energetique\" as \"dpe\" on \"dpe\".\"id_type_comptable\" = 1 and \"dpe\".\"activity_id\" = \"f\".\"activity_id\" and \"dpe\".\"fuel_cat_id\" = \"f\".\"fuel_cat_id\" where \"dtm\".\"parent_id\" in (-330926110) and \"f\".\"year_id\" in (2024) group by \"dtm\".\"parent_id\", \"f\".\"year_id\", \"dpe\".\"id\") as \"agg\" group by \"territoire_id\", \"year_id\") as \"dt\" inner join (select \"territoire_id\", \"year_id\", SUM(montant_euros) as montant_euros from (select \"dtm\".\"parent_id\" as \"territoire_id\", \"f\".\"year_id\", \"dpe\".\"id\" as \"poste_energetique_id\", SUM(f.montant_euros) as montant_euros from \"observatoire\".\"fact_recette_prod_energetique\" as \"f\" inner join \"observatoire\".\"dim_territory_memberships\" as \"dtm\" on \"dtm\".\"territory_id\" = \"f\".\"geo_id\" inner join \"observatoire\".\"dim_postes_energetique\" as \"dpe\" on \"dpe\".\"id_type_comptable\" = 2 and \"dpe\".\"filiere_detail_interne_id\" = \"f\".\"filiere_detail_interne_id\" and \"dpe\".\"vecteur_id\" = \"f\".\"vecteur_id\" where \"dtm\".\"parent_id\" in (-330926110) and \"f\".\"year_id\" in (2024) group by \"dtm\".\"parent_id\", \"f\".\"year_id\", \"dpe\".\"id\") as \"agg\" group by \"territoire_id\", \"year_id\") as \"rt\" on \"rt\".\"territoire_id\" = \"dt\".\"territoire_id\" and \"rt\".\"year_id\" = \"dt\".\"year_id\") as \"fg\" inner join (select \"dtm\".\"parent_id\" as \"territoire_id\", \"fp\".\"year_id\", SUM(fp.population) as population from \"observatoire\".\"fact_population\" as \"fp\" inner join \"observatoire\".\"dim_territory_memberships\" as \"dtm\" on \"dtm\".\"territory_id\" = \"fp\".\"geo_id\" where \"dtm\".\"parent_id\" in (-330926110) and \"fp\".\"year_id\" in (2024) group by \"dtm\".\"parent_id\", \"fp\".\"year_id\") as \"pa\" on \"pa\".\"territoire_id\" = \"fg\".\"territoire_id\" and \"pa\".\"year_id\" = \"fg\".\"year_id\")) as \"result\" left join \"observatoire\".\"dim_territories\" as \"t\" on \"t\".\"id\" = \"result\".\"territoire_id\" left join \"observatoire\".\"dim_postes_energetique\" as \"dpe\" on \"dpe\".\"id\" = \"result\".\"poste_energetique_id\" left join \"observatoire\".\"dim_activities\" as \"a\" on \"a\".\"id\" = \"dpe\".\"activity_id\" left join \"observatoire\".\"dim_fuels\" as \"fc\" on \"fc\".\"id\" = \"dpe\".\"fuel_cat_id\" left join \"observatoire\".\"dim_filieres\" as \"fdi\" on \"fdi\".\"id\" = \"dpe\".\"filiere_detail_interne_id\" left join \"observatoire\".\"dim_vecteurs\" as \"v\" on \"v\".\"id\" = \"dpe\".\"vecteur_id\""} 
[2026-08-06 14:30:42] local.DEBUG: ProductionQueryBuilder {"context":"App\\Services\\Inventaire\\{closure}","mode":"fact","source_table":"observatoire.fact_production","filter_level":"pnr","display_level":null,"years":[2024],"sql":"select fp.year_id, COALESCE(t.name, '(non rattaché)') AS territoire, COALESCE(fi.name, '(non rattaché)') AS filiere, 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 (-330926110)) 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 (-330926110) 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 (1298174201, -1583223985, 1270032335, -124248494, -1331514417, 1406800387, 1960668945, -1083934513, 1796054431, 462532502, -1497747537, 732180862, 1824193386, -1433878201, -844504743, 2065315848, -1014473487, -913750026, -1538118520, 897912354, -1843540233, 825071141, -1279318139, -543810268, -2097517554, -24603521, 403082322, -2094806066, 2023378393) inner join \"observatoire\".\"dim_filieres\" as \"fi\" on \"fi\".\"id\" = \"dtm_fi\".\"parent_id\" inner join \"observatoire\".\"dim_vecteurs\" as \"v\" on \"v\".\"id\" = \"fp\".\"vecteur_id\" where \"fp\".\"filiere_id\" in (-1316980943, -1589048475, 829965003, -1960216134, 801089390, 774281089, 1942610929, -929314708, 1506126584, 1413501954, -1193645855, 1033820579, -2102167500, -1312393098, 1498175839, 1716416743, -1936754040, 1371856852, 1963506075, -1839941303, 1961061561, -1004992653, 144162739, -243069253, -1982952820, -1958549795, 753002958, 1218982353, 193523191, 1680724918, -1109286771, -1165502792, 2023042180, 1500531356, 1723321957, 1340024063, -996979377, 1764268061, 1453260670, -1520867241, 2138005553, -498981429, -1392130500, 513682483, 1852304876, 967948000, -318804108, -1844241335, -1543929019, -1993658124, -1773246028, -1240650519, 1489167039, -992312423, 1200710728, 874142471) and \"fp\".\"vecteur_id\" in (3, 2, 1) group by \"fp\".\"year_id\", \"territoire\", \"filiere\", \"v\".\"name\""} 
[2026-08-06 14:30:42] local.DEBUG: ProductionQueryBuilder {"context":"App\\Services\\Inventaire\\{closure}","mode":"fact","source_table":"observatoire.fact_production","filter_level":"pnr","display_level":null,"years":[2024],"sql":"select fp.year_id, COALESCE(t.name, '(non rattaché)') AS territoire, COALESCE(fi.name, '(non rattaché)') AS filiere, 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 (-330926110)) 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 (-330926110) 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 (1298174201, -1583223985, 1270032335, -124248494, -1331514417, 1406800387, 1960668945, -1083934513, 1796054431, 462532502, -1497747537, 732180862, 1824193386, -1433878201, -844504743, 2065315848, -1014473487, -913750026, -1538118520, 897912354, -1843540233, 825071141, -1279318139, -543810268, -2097517554, -24603521, 403082322, -2094806066, 2023378393) inner join \"observatoire\".\"dim_filieres\" as \"fi\" on \"fi\".\"id\" = \"dtm_fi\".\"parent_id\" inner join \"observatoire\".\"dim_vecteurs\" as \"v\" on \"v\".\"id\" = \"fp\".\"vecteur_id\" where \"fp\".\"filiere_id\" in (-1316980943, -1589048475, 829965003, -1960216134, 801089390, 774281089, 1942610929, -929314708, 1506126584, 1413501954, -1193645855, 1033820579, -2102167500, -1312393098, 1498175839, 1716416743, -1936754040, 1371856852, 1963506075, -1839941303, 1961061561, -1004992653, 144162739, -243069253, -1982952820, -1958549795, 753002958, 1218982353, 193523191, 1680724918, -1109286771, -1165502792, 2023042180, 1500531356, 1723321957, 1340024063, -996979377, 1764268061, 1453260670, -1520867241, 2138005553, -498981429, -1392130500, 513682483, 1852304876, 967948000, -318804108, -1844241335, -1543929019, -1993658124, -1773246028, -1240650519, 1489167039, -992312423, 1200710728, 874142471) and \"fp\".\"vecteur_id\" in (3, 2, 1) group by \"fp\".\"year_id\", \"territoire\", \"filiere\", \"v\".\"name\""} 
[2026-08-06 14:43:02] local.DEBUG: EmissionQueryBuilder {"context":"App\\Services\\Inventaire\\{closure}","mode":"agg","source_table":"observatoire.agg_epci","filter_level":"epci","display_level":null,"years":[2024,2023],"sql":"select em.year_id, COALESCE(t.name, '(non rattaché)') AS territoire, ROUND(SUM(em.prg_2021_teqco2_pcaet)::numeric, 4) AS prg_2021_teqco2_pcaet from \"observatoire\".\"agg_epci\" as \"em\" left join \"observatoire\".\"dim_territories\" as \"t\" on \"t\".\"id\" = \"em\".\"geo_id\" where \"em\".\"year_id\" in (2024, 2023) and \"em\".\"geo_id\" in (-2074645457) 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-08-06 14:43:02] local.DEBUG: EmissionQueryBuilder {"context":"App\\Services\\Inventaire\\{closure}","mode":"agg","source_table":"observatoire.agg_epci","filter_level":"epci","display_level":null,"years":[2024,2023],"sql":"select em.year_id, COALESCE(t.name, '(non rattaché)') AS territoire, ROUND(SUM(em.prg_2021_teqco2_pcaet)::numeric, 4) AS prg_2021_teqco2_pcaet from \"observatoire\".\"agg_epci\" as \"em\" left join \"observatoire\".\"dim_territories\" as \"t\" on \"t\".\"id\" = \"em\".\"geo_id\" where \"em\".\"year_id\" in (2024, 2023) and \"em\".\"geo_id\" in (-2074645457) 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-08-06 14:43:58] 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, ROUND(SUM(fe1.prg_2021_teqco2_pcaet_n1)::numeric, 4) AS prg_2021_teqco2_pcaet_n1 from \"observatoire\".\"fact_estimation_n_1\" as \"fe1\" left join \"observatoire\".\"dim_territories\" as \"t\" on \"t\".\"id\" = \"fe1\".\"geo_id\" where \"fe1\".\"year_id\" in (2025) and \"fe1\".\"geo_id\" in (-2074645457) and \"fe1\".\"activity_secten_id\" not in (633536125, 1705364151) group by \"fe1\".\"year_id\", \"territoire\""} 
[2026-08-06 14:43:58] 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, ROUND(SUM(fe1.prg_2021_teqco2_pcaet_n1)::numeric, 4) AS prg_2021_teqco2_pcaet_n1 from \"observatoire\".\"fact_estimation_n_1\" as \"fe1\" left join \"observatoire\".\"dim_territories\" as \"t\" on \"t\".\"id\" = \"fe1\".\"geo_id\" where \"fe1\".\"year_id\" in (2025) and \"fe1\".\"geo_id\" in (-2074645457) and \"fe1\".\"activity_secten_id\" not in (633536125, 1705364151) group by \"fe1\".\"year_id\", \"territoire\""} 
[2026-08-06 14:44:03] 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.prg_2021_teqco2_pcaet_n1)::numeric, 4) AS prg_2021_teqco2_pcaet_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-08-06 14:44:03] 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.prg_2021_teqco2_pcaet_n1)::numeric, 4) AS prg_2021_teqco2_pcaet_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-08-06 14:53:00] local.DEBUG: EmissionQueryBuilder {"context":"App\\Services\\Inventaire\\{closure}","mode":"agg","source_table":"observatoire.agg_epci","filter_level":"epci","display_level":null,"years":[2024],"sql":"select em.year_id, COALESCE(t.name, '(non rattaché)') AS territoire, COALESCE(a.name, '(non rattaché)') AS activite, ROUND(SUM(em.prg_2021_teqco2_pcaet)::numeric, 4) AS prg_2021_teqco2_pcaet from \"observatoire\".\"agg_epci\" as \"em\" left join \"observatoire\".\"dim_territories\" as \"t\" on \"t\".\"id\" = \"em\".\"geo_id\" inner join \"observatoire\".\"dim_activity_memberships\" as \"dtm_a\" on \"dtm_a\".\"activity_id\" = \"em\".\"activity_id\" and \"dtm_a\".\"parent_id\" in (-622080275, 208862058, 74904297, 1926750763, 1705942411, -273970232, -1732845089, 14022040) inner join \"observatoire\".\"dim_activities\" as \"a\" on \"a\".\"id\" = \"dtm_a\".\"parent_id\" where \"em\".\"year_id\" in (2024) and \"em\".\"geo_id\" in (-2074645457) and \"em\".\"activity_id\" in (-2065015321, 1664202072, -1468143007, 1108698765, -697951920, 53616376, 911083398, -2129813176, -1918263047, -393206791, 562718587, 439277546, -858228785, 1839125859, 1824025864, 254468532, 1735525248, 240491429, 751538419, 1662919374, 1660135024, -2109039919, 97436677, -124660711, -1987478087, 722905366, -93516697, -818258464, -1982109166, 1409930224, -2034818798, 1822307428, -1758060949, 155019705, 1869212529, -609915394, 1481894613, 1395794963, 1695347196, 64335092, 921165895, -142018260, -482664252, 26668268, 942433737, 2101539831, -556896478, -289004236, 1180149453, -1100601087, 2113546912, -1166060768, -1270919973, 1741715211, -604604043, -1323823743, -65650287, -1771225083, 556015237, -497458774, 1890006254, -717879577, -475198975, 1306594475, 1087885866, -893165577, -1618922050, 409891242, -2075398489, 865842982, 1765509547, -1487210095, 76265396, 503239948, 1329377505, -2004721785, -1859723360, 1648387281, -731418973, -924061465, -519499276, -1689620327, 571578548, 1372013544, -2017652732, 506491597, 333711349, -1807500046, 680092381, 28083642, 879051533, -1167947622, 1900723648, -198132915, -567369811, 1273925006, 719954458, 1659802002, -1605866945, 1251539306, -1246034248, -2000350303, 122587945, 1855887801, 1307996793, -797747832, 1915345643, -719653191, -574407755, 747285232, 1757275487, 1312649538, 660808751, 1444864905, 82030098, 937605621, -1352377836, -407252425, 1763501654, -1405923019, 350725182, 1824837113, -1560607589, 682492730, 1303189715, 1734631443, 1243082219, 1140080948, -966852427, -632337157, 1663741761, -567757160, -1887790066, -837308181, -1623725498, -1436585389, -248116745, 2079193929, 1285586024, -1749430722, -717359299, -98448292, -853873446, -762838756, 1974523832, -1736763325, 859934642, 760580929, 1658855321, 138601578, 1153344103, 1280935296, -1951484904, 725270159, -1104146686, -225028528, -469721241, -1445420861, -2104684761, -1259394394, 1942080707, -913831972, 350561514, 1206983340, 1633334487, -1017289816, -843932025, -337017078, 454621909, 41079158, -1846591393, 804338617, 1352484195, 1426270099, -1732290900, 1353783048, -1078990055, -307626332, 2128833364, 1054770029, -740347188, -1430328674, 730376509, 504001257, -1859749546, -435776990, -2102767552, -933330074, 112476696, -446796902, -1546313589, 1663401832, 1104829866, -323474854, 906942419, -2009648112, -1608512036, 489987876, 301093584, 1663410790, -820564035, 1066750091, 2110173394, -2048915241, 859987309, 1134610842, -1219234331, 1099679168, 1855856603, -964500217, 21511964, 1388087176, 1967813158, -1063238036, -570672305, 2106414096, 1913359952, -2145734036, 342527500, 429059437, -295738415, -376271361, 827134186, 2047409618, 1519990054, -1487774563, 153764150, 1371033649, 776279000, 692870153, -1951358321, -889255393, 905336003, -1528757905, -1313144583, -189572407, 1219243506, -1959662381, -667330531, -1327037360, -388600018, -1768991392, 631501363, 1428443613, -794523335, -921669000, 50809254, -1151061648, -263558204, -1316167746, 254882134, -1432964826, 971161973, -869291431, -92274995, 2001828071, 717533312, -919698739, -115032065, -1710809284, 1440646841, 438839785, 1838130794, -1438657658, -2100037337, -1645230407, -35163706, -244693147, 747547873, -178006637, -316787613, -1609021450, 425592013, 1142721112, 1125960239, 342687363, -715496447, -466654990, -22267807, 2004972987, 373557710, -538767368, -583628804, 1231105243, -148499659, -1978708979, 1035684050, 595015853, 1713779118, 530155604, 1319740754, -1878882180, -578878727, 46178169, 1173150921, 707403387, 595454509, 2093595260, -178885722, 1933574569, 1689971204, 2099170107, -23642967, -893109849, -394754806, -1052690536, 373550100, -1337323363, 1447225472, 1276215965, 33249239, 730336352, -639410621, 932667705, -1839258623, 1911698987, -37699356, -982013561, -1459018491, -883327242, 1252179801, -450105656, -799071091, -1118403434, -432827018, -2125877781, -1464392700, -1334310062, 1371610371, -1652853783, 2106513667, -1320908412, -1981687934, 1764341119, -457559919, -1414713643, -394200259, -1573937312, -1087220802, 1173327443, 1942963054, -1193483522, 575519546, 1411111401, -50696485, -390568655, -1496086086, -273047452, 1578846294, -1189987097, -366685926, -390542442, 310956635, 494216435, -1591836854, -1958561345, 2001630306, -1144004711, 942233085, -1824930634, -35558533, -1345162752, 1713162907, -600367835, -1294709678, -356747582, -761498023, -1171478393, -487172781, -1805861555, 1024219564, 579293477, 1140113838, -1419278172, 2024238092, -182420025, -1904591798, 2117082238, 1974281097, -1743267982, -919487101, -770400240, -1939219148, 1687214361, -543242059, 1687613177, 692025924, 1949554747, -1071587566, 216692383, -1231239857, -301100043, 1184608045, 1570062812, 1744165561, -2024511393, -2117292693, -183910117, -1210454800, 933754793, 1924478818, 1584015331, -1929400904, -1865280307, 589008399, -125964541, 1640238785, -1829002824, 1898736760, 2108532170, 1044726750, 1923261691, 1227983953, -1363934197, 384410393, -2044885611, 919914692, 736532642, -1239747894, -1632648707, 2134862632, 1386497909, -1028097404, -1390684557, 2139709518, -1273156420, 1222056809, 539391017, 515802054, -2129230707, -1408995398, 632880332, 1772504308, -966063115, -1799725714, 21937287, 1477165581, 1253744553, 203783501, 1236677003, 689872, 1075533786, 1649769611, -97814566, -337441085, 675577244, 1367391544, 1379603351, 1049700765, 847335499, -14567500, -118886754, 1563060129, -1287483713, 1574055369, -1513139721, -1389614002, -1144038162, 775868583, -606258386, -1987052516, 1855178673, -2044004547, -1581253380, 1201608055, 85619372, -68842748, -1279064480, 2005250983, -307341145, 1996142013, 375123593, -271055130, -1781860008, 1096813866, 1849745898, 1007707851, -1605275342, -2140441286, 739923250, -704377305, -467115791, 1079222860, 242615640, -1837178453, 318613241, 347811431, -197558611, -2019686765, -980556544, 1553348267, 494206472, 1112036812, 1258750298, -842445917, 1544265955, -1912564262, -620488471, -889282158, 1299296056, 423665295, 1359890860, 1077172953, -73273843, -1659840926, 1392617912, -1081530607, 1303291967, 392392088, -2017022783, 1184793512, -1869570613, -955858860, 340061913, 618379975, 1011823494, -809881216, 1816787957, 1978588983, -1138006003, 2078237231, 1842692073, -620524373, -1715977758, -939991847, 1418466514, 1620817717, 1901794668, -1390883660, 1843164580, 1743133853, 578558002, -1932993837, -858994155, -1461717196, 1528030456, 1435696692, -648559285, -302632139, -1607714348, 223376167, 1711779466, 317524838, -1082127435, -1990228258, -668408596, 548540297, 1651542945, -1614026445, -1832238632, -1037581785, -1523665978, 600270447, -574372648, -763786315, 283393782, 1770243570, -734407698, -1703285931, -327559973, -1788065014, 960709480, -1814854069, -908948374, -436117987, 1682085334, -762279866, -183191368, 220080184, -57766241, -676428704, 1598532481, -1255434042, 1989286800, -1717498989, 1784442077, -1337246483, 1458785475, -1332638305, 145755964, -1074151148, 1287376035, 1362332800, 224035916, -23479538, -1409046242, -694125069, -566762324, -630866531, -347269928, 679566165, 276545043, 366390502, 288394184, -1914964681, -1286440751, -2020552257, 1678295557, -443199195, -1935636633, 2101386234, 818513443, -708582396, 1983248498, -1871954656, -161206170, -1859668546, -1151541471, 988479706, -1460631101, 971904816, -1519785494, -1915212800, -1888967964, -1802228876, -1296777115, 1201309406, -1531584106, 826582647, 118055960, -1132107069, -373631934, -1371339394, -1940516137, 1127749479, 1201351105, 68476456, -1744193508, -306861080, -980025384, -2072230927, -1736978617, 1572698384, 1177367976, -1156123924, 775840687, -1727327625, -38219474, -2063183380, -1110362267, 1684813422, -884896557, 1016574566, 803377337, 540645732, -1240017080, -1178332843, 2034593037, 1429295941, 1034344725, 1381736146, -62446596, -833249209, 1611256781, -1200401518, -518501295, 1572749265, -807863775, -746688917, 1656148124, -1201074141, 922162158, 302308805, 2079850451, 1040750617, 2011035759, 1436256879, 344405547, 1340950393, 1207010603, 1972919535, -2062377130, -975191328, -973132685, -1556578693, 931702417, -1990261158, 35115389, -1650124362, 500851691, -1315688156) 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\", \"activite\""} 
[2026-08-06 14:53:01] local.DEBUG: EmissionQueryBuilder {"context":"App\\Services\\Inventaire\\{closure}","mode":"agg","source_table":"observatoire.agg_epci","filter_level":"epci","display_level":null,"years":[2024],"sql":"select em.year_id, COALESCE(t.name, '(non rattaché)') AS territoire, COALESCE(a.name, '(non rattaché)') AS activite, ROUND(SUM(em.prg_2021_teqco2_pcaet)::numeric, 4) AS prg_2021_teqco2_pcaet from \"observatoire\".\"agg_epci\" as \"em\" left join \"observatoire\".\"dim_territories\" as \"t\" on \"t\".\"id\" = \"em\".\"geo_id\" inner join \"observatoire\".\"dim_activity_memberships\" as \"dtm_a\" on \"dtm_a\".\"activity_id\" = \"em\".\"activity_id\" and \"dtm_a\".\"parent_id\" in (-622080275, 208862058, 74904297, 1926750763, 1705942411, -273970232, -1732845089, 14022040) inner join \"observatoire\".\"dim_activities\" as \"a\" on \"a\".\"id\" = \"dtm_a\".\"parent_id\" where \"em\".\"year_id\" in (2024) and \"em\".\"geo_id\" in (-2074645457) and \"em\".\"activity_id\" in (-2065015321, 1664202072, -1468143007, 1108698765, -697951920, 53616376, 911083398, -2129813176, -1918263047, -393206791, 562718587, 439277546, -858228785, 1839125859, 1824025864, 254468532, 1735525248, 240491429, 751538419, 1662919374, 1660135024, -2109039919, 97436677, -124660711, -1987478087, 722905366, -93516697, -818258464, -1982109166, 1409930224, -2034818798, 1822307428, -1758060949, 155019705, 1869212529, -609915394, 1481894613, 1395794963, 1695347196, 64335092, 921165895, -142018260, -482664252, 26668268, 942433737, 2101539831, -556896478, -289004236, 1180149453, -1100601087, 2113546912, -1166060768, -1270919973, 1741715211, -604604043, -1323823743, -65650287, -1771225083, 556015237, -497458774, 1890006254, -717879577, -475198975, 1306594475, 1087885866, -893165577, -1618922050, 409891242, -2075398489, 865842982, 1765509547, -1487210095, 76265396, 503239948, 1329377505, -2004721785, -1859723360, 1648387281, -731418973, -924061465, -519499276, -1689620327, 571578548, 1372013544, -2017652732, 506491597, 333711349, -1807500046, 680092381, 28083642, 879051533, -1167947622, 1900723648, -198132915, -567369811, 1273925006, 719954458, 1659802002, -1605866945, 1251539306, -1246034248, -2000350303, 122587945, 1855887801, 1307996793, -797747832, 1915345643, -719653191, -574407755, 747285232, 1757275487, 1312649538, 660808751, 1444864905, 82030098, 937605621, -1352377836, -407252425, 1763501654, -1405923019, 350725182, 1824837113, -1560607589, 682492730, 1303189715, 1734631443, 1243082219, 1140080948, -966852427, -632337157, 1663741761, -567757160, -1887790066, -837308181, -1623725498, -1436585389, -248116745, 2079193929, 1285586024, -1749430722, -717359299, -98448292, -853873446, -762838756, 1974523832, -1736763325, 859934642, 760580929, 1658855321, 138601578, 1153344103, 1280935296, -1951484904, 725270159, -1104146686, -225028528, -469721241, -1445420861, -2104684761, -1259394394, 1942080707, -913831972, 350561514, 1206983340, 1633334487, -1017289816, -843932025, -337017078, 454621909, 41079158, -1846591393, 804338617, 1352484195, 1426270099, -1732290900, 1353783048, -1078990055, -307626332, 2128833364, 1054770029, -740347188, -1430328674, 730376509, 504001257, -1859749546, -435776990, -2102767552, -933330074, 112476696, -446796902, -1546313589, 1663401832, 1104829866, -323474854, 906942419, -2009648112, -1608512036, 489987876, 301093584, 1663410790, -820564035, 1066750091, 2110173394, -2048915241, 859987309, 1134610842, -1219234331, 1099679168, 1855856603, -964500217, 21511964, 1388087176, 1967813158, -1063238036, -570672305, 2106414096, 1913359952, -2145734036, 342527500, 429059437, -295738415, -376271361, 827134186, 2047409618, 1519990054, -1487774563, 153764150, 1371033649, 776279000, 692870153, -1951358321, -889255393, 905336003, -1528757905, -1313144583, -189572407, 1219243506, -1959662381, -667330531, -1327037360, -388600018, -1768991392, 631501363, 1428443613, -794523335, -921669000, 50809254, -1151061648, -263558204, -1316167746, 254882134, -1432964826, 971161973, -869291431, -92274995, 2001828071, 717533312, -919698739, -115032065, -1710809284, 1440646841, 438839785, 1838130794, -1438657658, -2100037337, -1645230407, -35163706, -244693147, 747547873, -178006637, -316787613, -1609021450, 425592013, 1142721112, 1125960239, 342687363, -715496447, -466654990, -22267807, 2004972987, 373557710, -538767368, -583628804, 1231105243, -148499659, -1978708979, 1035684050, 595015853, 1713779118, 530155604, 1319740754, -1878882180, -578878727, 46178169, 1173150921, 707403387, 595454509, 2093595260, -178885722, 1933574569, 1689971204, 2099170107, -23642967, -893109849, -394754806, -1052690536, 373550100, -1337323363, 1447225472, 1276215965, 33249239, 730336352, -639410621, 932667705, -1839258623, 1911698987, -37699356, -982013561, -1459018491, -883327242, 1252179801, -450105656, -799071091, -1118403434, -432827018, -2125877781, -1464392700, -1334310062, 1371610371, -1652853783, 2106513667, -1320908412, -1981687934, 1764341119, -457559919, -1414713643, -394200259, -1573937312, -1087220802, 1173327443, 1942963054, -1193483522, 575519546, 1411111401, -50696485, -390568655, -1496086086, -273047452, 1578846294, -1189987097, -366685926, -390542442, 310956635, 494216435, -1591836854, -1958561345, 2001630306, -1144004711, 942233085, -1824930634, -35558533, -1345162752, 1713162907, -600367835, -1294709678, -356747582, -761498023, -1171478393, -487172781, -1805861555, 1024219564, 579293477, 1140113838, -1419278172, 2024238092, -182420025, -1904591798, 2117082238, 1974281097, -1743267982, -919487101, -770400240, -1939219148, 1687214361, -543242059, 1687613177, 692025924, 1949554747, -1071587566, 216692383, -1231239857, -301100043, 1184608045, 1570062812, 1744165561, -2024511393, -2117292693, -183910117, -1210454800, 933754793, 1924478818, 1584015331, -1929400904, -1865280307, 589008399, -125964541, 1640238785, -1829002824, 1898736760, 2108532170, 1044726750, 1923261691, 1227983953, -1363934197, 384410393, -2044885611, 919914692, 736532642, -1239747894, -1632648707, 2134862632, 1386497909, -1028097404, -1390684557, 2139709518, -1273156420, 1222056809, 539391017, 515802054, -2129230707, -1408995398, 632880332, 1772504308, -966063115, -1799725714, 21937287, 1477165581, 1253744553, 203783501, 1236677003, 689872, 1075533786, 1649769611, -97814566, -337441085, 675577244, 1367391544, 1379603351, 1049700765, 847335499, -14567500, -118886754, 1563060129, -1287483713, 1574055369, -1513139721, -1389614002, -1144038162, 775868583, -606258386, -1987052516, 1855178673, -2044004547, -1581253380, 1201608055, 85619372, -68842748, -1279064480, 2005250983, -307341145, 1996142013, 375123593, -271055130, -1781860008, 1096813866, 1849745898, 1007707851, -1605275342, -2140441286, 739923250, -704377305, -467115791, 1079222860, 242615640, -1837178453, 318613241, 347811431, -197558611, -2019686765, -980556544, 1553348267, 494206472, 1112036812, 1258750298, -842445917, 1544265955, -1912564262, -620488471, -889282158, 1299296056, 423665295, 1359890860, 1077172953, -73273843, -1659840926, 1392617912, -1081530607, 1303291967, 392392088, -2017022783, 1184793512, -1869570613, -955858860, 340061913, 618379975, 1011823494, -809881216, 1816787957, 1978588983, -1138006003, 2078237231, 1842692073, -620524373, -1715977758, -939991847, 1418466514, 1620817717, 1901794668, -1390883660, 1843164580, 1743133853, 578558002, -1932993837, -858994155, -1461717196, 1528030456, 1435696692, -648559285, -302632139, -1607714348, 223376167, 1711779466, 317524838, -1082127435, -1990228258, -668408596, 548540297, 1651542945, -1614026445, -1832238632, -1037581785, -1523665978, 600270447, -574372648, -763786315, 283393782, 1770243570, -734407698, -1703285931, -327559973, -1788065014, 960709480, -1814854069, -908948374, -436117987, 1682085334, -762279866, -183191368, 220080184, -57766241, -676428704, 1598532481, -1255434042, 1989286800, -1717498989, 1784442077, -1337246483, 1458785475, -1332638305, 145755964, -1074151148, 1287376035, 1362332800, 224035916, -23479538, -1409046242, -694125069, -566762324, -630866531, -347269928, 679566165, 276545043, 366390502, 288394184, -1914964681, -1286440751, -2020552257, 1678295557, -443199195, -1935636633, 2101386234, 818513443, -708582396, 1983248498, -1871954656, -161206170, -1859668546, -1151541471, 988479706, -1460631101, 971904816, -1519785494, -1915212800, -1888967964, -1802228876, -1296777115, 1201309406, -1531584106, 826582647, 118055960, -1132107069, -373631934, -1371339394, -1940516137, 1127749479, 1201351105, 68476456, -1744193508, -306861080, -980025384, -2072230927, -1736978617, 1572698384, 1177367976, -1156123924, 775840687, -1727327625, -38219474, -2063183380, -1110362267, 1684813422, -884896557, 1016574566, 803377337, 540645732, -1240017080, -1178332843, 2034593037, 1429295941, 1034344725, 1381736146, -62446596, -833249209, 1611256781, -1200401518, -518501295, 1572749265, -807863775, -746688917, 1656148124, -1201074141, 922162158, 302308805, 2079850451, 1040750617, 2011035759, 1436256879, 344405547, 1340950393, 1207010603, 1972919535, -2062377130, -975191328, -973132685, -1556578693, 931702417, -1990261158, 35115389, -1650124362, 500851691, -1315688156) 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\", \"activite\""} 
[2026-08-06 14:53:10] local.DEBUG: EmissionQueryBuilder {"context":"App\\Services\\Inventaire\\{closure}","mode":"agg","source_table":"observatoire.agg_epci","filter_level":"epci","display_level":null,"years":[2024],"sql":"select em.year_id, COALESCE(t.name, '(non rattaché)') AS territoire, COALESCE(a.name, '(non rattaché)') AS activite, ROUND(SUM(em.prg_2021_teqco2_pcaet)::numeric, 4) AS prg_2021_teqco2_pcaet from \"observatoire\".\"agg_epci\" as \"em\" left join \"observatoire\".\"dim_territories\" as \"t\" on \"t\".\"id\" = \"em\".\"geo_id\" inner join \"observatoire\".\"dim_activity_memberships\" as \"dtm_a\" on \"dtm_a\".\"activity_id\" = \"em\".\"activity_id\" and \"dtm_a\".\"parent_id\" in (-622080275, 208862058, 74904297, 1926750763, 1705942411, -273970232, -1732845089, 14022040) inner join \"observatoire\".\"dim_activities\" as \"a\" on \"a\".\"id\" = \"dtm_a\".\"parent_id\" where \"em\".\"year_id\" in (2024) and \"em\".\"geo_id\" in (-2074645457) and \"em\".\"activity_id\" in (-2065015321, 1664202072, -1468143007, 1108698765, -697951920, 53616376, 911083398, -2129813176, -1918263047, -393206791, 562718587, 439277546, -858228785, 1839125859, 1824025864, 254468532, 1735525248, 240491429, 751538419, 1662919374, 1660135024, -2109039919, 97436677, -124660711, -1987478087, 722905366, -93516697, -818258464, -1982109166, 1409930224, -2034818798, 1822307428, -1758060949, 155019705, 1869212529, -609915394, 1481894613, 1395794963, 1695347196, 64335092, 921165895, -142018260, -482664252, 26668268, 942433737, 2101539831, -556896478, -289004236, 1180149453, -1100601087, 2113546912, -1166060768, -1270919973, 1741715211, -604604043, -1323823743, -65650287, -1771225083, 556015237, -497458774, 1890006254, -717879577, -475198975, 1306594475, 1087885866, -893165577, -1618922050, 409891242, -2075398489, 865842982, 1765509547, -1487210095, 76265396, 503239948, 1329377505, -2004721785, -1859723360, 1648387281, -731418973, -924061465, -519499276, -1689620327, 571578548, 1372013544, -2017652732, 506491597, 333711349, -1807500046, 680092381, 28083642, 879051533, -1167947622, 1900723648, -198132915, -567369811, 1273925006, 719954458, 1659802002, -1605866945, 1251539306, -1246034248, -2000350303, 122587945, 1855887801, 1307996793, -797747832, 1915345643, -719653191, -574407755, 747285232, 1757275487, 1312649538, 660808751, 1444864905, 82030098, 937605621, -1352377836, -407252425, 1763501654, -1405923019, 350725182, 1824837113, -1560607589, 682492730, 1303189715, 1734631443, 1243082219, 1140080948, -966852427, -632337157, 1663741761, -567757160, -1887790066, -837308181, -1623725498, -1436585389, -248116745, 2079193929, 1285586024, -1749430722, -717359299, -98448292, -853873446, -762838756, 1974523832, -1736763325, 859934642, 760580929, 1658855321, 138601578, 1153344103, 1280935296, -1951484904, 725270159, -1104146686, -225028528, -469721241, -1445420861, -2104684761, -1259394394, 1942080707, -913831972, 350561514, 1206983340, 1633334487, -1017289816, -843932025, -337017078, 454621909, 41079158, -1846591393, 804338617, 1352484195, 1426270099, -1732290900, 1353783048, -1078990055, -307626332, 2128833364, 1054770029, -740347188, -1430328674, 730376509, 504001257, -1859749546, -435776990, -2102767552, -933330074, 112476696, -446796902, -1546313589, 1663401832, 1104829866, -323474854, 906942419, -2009648112, -1608512036, 489987876, 301093584, 1663410790, -820564035, 1066750091, 2110173394, -2048915241, 859987309, 1134610842, -1219234331, 1099679168, 1855856603, -964500217, 21511964, 1388087176, 1967813158, -1063238036, -570672305, 2106414096, 1913359952, -2145734036, 342527500, 429059437, -295738415, -376271361, 827134186, 2047409618, 1519990054, -1487774563, 153764150, 1371033649, 776279000, 692870153, -1951358321, -889255393, 905336003, -1528757905, -1313144583, -189572407, 1219243506, -1959662381, -667330531, -1327037360, -388600018, -1768991392, 631501363, 1428443613, -794523335, -921669000, 50809254, -1151061648, -263558204, -1316167746, 254882134, -1432964826, 971161973, -869291431, -92274995, 2001828071, 717533312, -919698739, -115032065, -1710809284, 1440646841, 438839785, 1838130794, -1438657658, -2100037337, -1645230407, -35163706, -244693147, 747547873, -178006637, -316787613, -1609021450, 425592013, 1142721112, 1125960239, 342687363, -715496447, -466654990, -22267807, 2004972987, 373557710, -538767368, -583628804, 1231105243, -148499659, -1978708979, 1035684050, 595015853, 1713779118, 530155604, 1319740754, -1878882180, -578878727, 46178169, 1173150921, 707403387, 595454509, 2093595260, -178885722, 1933574569, 1689971204, 2099170107, -23642967, -893109849, -394754806, -1052690536, 373550100, -1337323363, 1447225472, 1276215965, 33249239, 730336352, -639410621, 932667705, -1839258623, 1911698987, -37699356, -982013561, -1459018491, -883327242, 1252179801, -450105656, -799071091, -1118403434, -432827018, -2125877781, -1464392700, -1334310062, 1371610371, -1652853783, 2106513667, -1320908412, -1981687934, 1764341119, -457559919, -1414713643, -394200259, -1573937312, -1087220802, 1173327443, 1942963054, -1193483522, 575519546, 1411111401, -50696485, -390568655, -1496086086, -273047452, 1578846294, -1189987097, -366685926, -390542442, 310956635, 494216435, -1591836854, -1958561345, 2001630306, -1144004711, 942233085, -1824930634, -35558533, -1345162752, 1713162907, -600367835, -1294709678, -356747582, -761498023, -1171478393, -487172781, -1805861555, 1024219564, 579293477, 1140113838, -1419278172, 2024238092, -182420025, -1904591798, 2117082238, 1974281097, -1743267982, -919487101, -770400240, -1939219148, 1687214361, -543242059, 1687613177, 692025924, 1949554747, -1071587566, 216692383, -1231239857, -301100043, 1184608045, 1570062812, 1744165561, -2024511393, -2117292693, -183910117, -1210454800, 933754793, 1924478818, 1584015331, -1929400904, -1865280307, 589008399, -125964541, 1640238785, -1829002824, 1898736760, 2108532170, 1044726750, 1923261691, 1227983953, -1363934197, 384410393, -2044885611, 919914692, 736532642, -1239747894, -1632648707, 2134862632, 1386497909, -1028097404, -1390684557, 2139709518, -1273156420, 1222056809, 539391017, 515802054, -2129230707, -1408995398, 632880332, 1772504308, -966063115, -1799725714, 21937287, 1477165581, 1253744553, 203783501, 1236677003, 689872, 1075533786, 1649769611, -97814566, -337441085, 675577244, 1367391544, 1379603351, 1049700765, 847335499, -14567500, -118886754, 1563060129, -1287483713, 1574055369, -1513139721, -1389614002, -1144038162, 775868583, -606258386, -1987052516, 1855178673, -2044004547, -1581253380, 1201608055, 85619372, -68842748, -1279064480, 2005250983, -307341145, 1996142013, 375123593, -271055130, -1781860008, 1096813866, 1849745898, 1007707851, -1605275342, -2140441286, 739923250, -704377305, -467115791, 1079222860, 242615640, -1837178453, 318613241, 347811431, -197558611, -2019686765, -980556544, 1553348267, 494206472, 1112036812, 1258750298, -842445917, 1544265955, -1912564262, -620488471, -889282158, 1299296056, 423665295, 1359890860, 1077172953, -73273843, -1659840926, 1392617912, -1081530607, 1303291967, 392392088, -2017022783, 1184793512, -1869570613, -955858860, 340061913, 618379975, 1011823494, -809881216, 1816787957, 1978588983, -1138006003, 2078237231, 1842692073, -620524373, -1715977758, -939991847, 1418466514, 1620817717, 1901794668, -1390883660, 1843164580, 1743133853, 578558002, -1932993837, -858994155, -1461717196, 1528030456, 1435696692, -648559285, -302632139, -1607714348, 223376167, 1711779466, 317524838, -1082127435, -1990228258, -668408596, 548540297, 1651542945, -1614026445, -1832238632, -1037581785, -1523665978, 600270447, -574372648, -763786315, 283393782, 1770243570, -734407698, -1703285931, -327559973, -1788065014, 960709480, -1814854069, -908948374, -436117987, 1682085334, -762279866, -183191368, 220080184, -57766241, -676428704, 1598532481, -1255434042, 1989286800, -1717498989, 1784442077, -1337246483, 1458785475, -1332638305, 145755964, -1074151148, 1287376035, 1362332800, 224035916, -23479538, -1409046242, -694125069, -566762324, -630866531, -347269928, 679566165, 276545043, 366390502, 288394184, -1914964681, -1286440751, -2020552257, 1678295557, -443199195, -1935636633, 2101386234, 818513443, -708582396, 1983248498, -1871954656, -161206170, -1859668546, -1151541471, 988479706, -1460631101, 971904816, -1519785494, -1915212800, -1888967964, -1802228876, -1296777115, 1201309406, -1531584106, 826582647, 118055960, -1132107069, -373631934, -1371339394, -1940516137, 1127749479, 1201351105, 68476456, -1744193508, -306861080, -980025384, -2072230927, -1736978617, 1572698384, 1177367976, -1156123924, 775840687, -1727327625, -38219474, -2063183380, -1110362267, 1684813422, -884896557, 1016574566, 803377337, 540645732, -1240017080, -1178332843, 2034593037, 1429295941, 1034344725, 1381736146, -62446596, -833249209, 1611256781, -1200401518, -518501295, 1572749265, -807863775, -746688917, 1656148124, -1201074141, 922162158, 302308805, 2079850451, 1040750617, 2011035759, 1436256879, 344405547, 1340950393, 1207010603, 1972919535, -2062377130, -975191328, -973132685, -1556578693, 931702417, -1990261158, 35115389, -1650124362, 500851691, -1315688156) 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\", \"activite\""} 
[2026-08-06 14:53:11] 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.prg_2021_teqco2_pcaet_n1)::numeric, 4) AS prg_2021_teqco2_pcaet_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-08-06 15:01:41] local.DEBUG: EmissionQueryBuilder {"context":"App\\Services\\Inventaire\\{closure}","mode":"agg","source_table":"observatoire.agg_epci","filter_level":"epci","display_level":null,"years":[2024],"sql":"select em.year_id, COALESCE(t.name, '(non rattaché)') AS territoire, COALESCE(a.name, '(non rattaché)') AS activite, ROUND((SUM(em.conso_ener_finale_clim_reel_gj)/3.6)::numeric, 2) AS conso_ener_finale_clim_reel_gj from \"observatoire\".\"agg_epci\" as \"em\" left join \"observatoire\".\"dim_territories\" as \"t\" on \"t\".\"id\" = \"em\".\"geo_id\" inner join \"observatoire\".\"dim_activity_memberships\" as \"dtm_a\" on \"dtm_a\".\"activity_id\" = \"em\".\"activity_id\" and \"dtm_a\".\"parent_id\" in (-622080275, 208862058, 74904297, 1926750763, 1705942411, -273970232, -1732845089, 14022040) inner join \"observatoire\".\"dim_activities\" as \"a\" on \"a\".\"id\" = \"dtm_a\".\"parent_id\" where \"em\".\"year_id\" in (2024) and \"em\".\"geo_id\" in (-2074645457) and \"em\".\"activity_id\" in (-2065015321, 1664202072, -1468143007, 1108698765, -697951920, 53616376, 911083398, -2129813176, -1918263047, -393206791, 562718587, 439277546, -858228785, 1839125859, 1824025864, 254468532, 1735525248, 240491429, 751538419, 1662919374, 1660135024, -2109039919, 97436677, -124660711, -1987478087, 722905366, -93516697, -818258464, -1982109166, 1409930224, -2034818798, 1822307428, -1758060949, 155019705, 1869212529, -609915394, 1481894613, 1395794963, 1695347196, 64335092, 921165895, -142018260, -482664252, 26668268, 942433737, 2101539831, -556896478, -289004236, 1180149453, -1100601087, 2113546912, -1166060768, -1270919973, 1741715211, -604604043, -1323823743, -65650287, -1771225083, 556015237, -497458774, 1890006254, -717879577, -475198975, 1306594475, 1087885866, -893165577, -1618922050, 409891242, -2075398489, 865842982, 1765509547, -1487210095, 76265396, 503239948, 1329377505, -2004721785, -1859723360, 1648387281, -731418973, -924061465, -519499276, -1689620327, 571578548, 1372013544, -2017652732, 506491597, 333711349, -1807500046, 680092381, 28083642, 879051533, -1167947622, 1900723648, -198132915, -567369811, 1273925006, 719954458, 1659802002, -1605866945, 1251539306, -1246034248, -2000350303, 122587945, 1855887801, 1307996793, -797747832, 1915345643, -719653191, -574407755, 747285232, 1757275487, 1312649538, 660808751, 1444864905, 82030098, 937605621, -1352377836, -407252425, 1763501654, -1405923019, 350725182, 1824837113, -1560607589, 682492730, 1303189715, 1734631443, 1243082219, 1140080948, -966852427, -632337157, 1663741761, -567757160, -1887790066, -837308181, -1623725498, -1436585389, -248116745, 2079193929, 1285586024, -1749430722, -717359299, -98448292, -853873446, -762838756, 1974523832, -1736763325, 859934642, 760580929, 1658855321, 138601578, 1153344103, 1280935296, -1951484904, 725270159, -1104146686, -225028528, -469721241, -1445420861, -2104684761, -1259394394, 1942080707, -913831972, 350561514, 1206983340, 1633334487, -1017289816, -843932025, -337017078, 454621909, 41079158, -1846591393, 804338617, 1352484195, 1426270099, -1732290900, 1353783048, -1078990055, -307626332, 2128833364, 1054770029, -740347188, -1430328674, 730376509, 504001257, -1859749546, -435776990, -2102767552, -933330074, 112476696, -446796902, -1546313589, 1663401832, 1104829866, -323474854, 906942419, -2009648112, -1608512036, 489987876, 301093584, 1663410790, -820564035, 1066750091, 2110173394, -2048915241, 859987309, 1134610842, -1219234331, 1099679168, 1855856603, -964500217, 21511964, 1388087176, 1967813158, -1063238036, -570672305, 2106414096, 1913359952, -2145734036, 342527500, 429059437, -295738415, -376271361, 827134186, 2047409618, 1519990054, -1487774563, 153764150, 1371033649, 776279000, 692870153, -1951358321, -889255393, 905336003, -1528757905, -1313144583, -189572407, 1219243506, -1959662381, -667330531, -1327037360, -388600018, -1768991392, 631501363, 1428443613, -794523335, -921669000, 50809254, -1151061648, -263558204, -1316167746, 254882134, -1432964826, 971161973, -869291431, -92274995, 2001828071, 717533312, -919698739, -115032065, -1710809284, 1440646841, 438839785, 1838130794, -1438657658, -2100037337, -1645230407, -35163706, -244693147, 747547873, -178006637, -316787613, -1609021450, 425592013, 1142721112, 1125960239, 342687363, -715496447, -466654990, -22267807, 2004972987, 373557710, -538767368, -583628804, 1231105243, -148499659, -1978708979, 1035684050, 595015853, 1713779118, 530155604, 1319740754, -1878882180, -578878727, 46178169, 1173150921, 707403387, 595454509, 2093595260, -178885722, 1933574569, 1689971204, 2099170107, -23642967, -893109849, -394754806, -1052690536, 373550100, -1337323363, 1447225472, 1276215965, 33249239, 730336352, -639410621, 932667705, -1839258623, 1911698987, -37699356, -982013561, -1459018491, -883327242, 1252179801, -450105656, -799071091, -1118403434, -432827018, -2125877781, -1464392700, -1334310062, 1371610371, -1652853783, 2106513667, -1320908412, -1981687934, 1764341119, -457559919, -1414713643, -394200259, -1573937312, -1087220802, 1173327443, 1942963054, -1193483522, 575519546, 1411111401, -50696485, -390568655, -1496086086, -273047452, 1578846294, -1189987097, -366685926, -390542442, 310956635, 494216435, -1591836854, -1958561345, 2001630306, -1144004711, 942233085, -1824930634, -35558533, -1345162752, 1713162907, -600367835, -1294709678, -356747582, -761498023, -1171478393, -487172781, -1805861555, 1024219564, 579293477, 1140113838, -1419278172, 2024238092, -182420025, -1904591798, 2117082238, 1974281097, -1743267982, -919487101, -770400240, -1939219148, 1687214361, -543242059, 1687613177, 692025924, 1949554747, -1071587566, 216692383, -1231239857, -301100043, 1184608045, 1570062812, 1744165561, -2024511393, -2117292693, -183910117, -1210454800, 933754793, 1924478818, 1584015331, -1929400904, -1865280307, 589008399, -125964541, 1640238785, -1829002824, 1898736760, 2108532170, 1044726750, 1923261691, 1227983953, -1363934197, 384410393, -2044885611, 919914692, 736532642, -1239747894, -1632648707, 2134862632, 1386497909, -1028097404, -1390684557, 2139709518, -1273156420, 1222056809, 539391017, 515802054, -2129230707, -1408995398, 632880332, 1772504308, -966063115, -1799725714, 21937287, 1477165581, 1253744553, 203783501, 1236677003, 689872, 1075533786, 1649769611, -97814566, -337441085, 675577244, 1367391544, 1379603351, 1049700765, 847335499, -14567500, -118886754, 1563060129, -1287483713, 1574055369, -1513139721, -1389614002, -1144038162, 775868583, -606258386, -1987052516, 1855178673, -2044004547, -1581253380, 1201608055, 85619372, -68842748, -1279064480, 2005250983, -307341145, 1996142013, 375123593, -271055130, -1781860008, 1096813866, 1849745898, 1007707851, -1605275342, -2140441286, 739923250, -704377305, -467115791, 1079222860, 242615640, -1837178453, 318613241, 347811431, -197558611, -2019686765, -980556544, 1553348267, 494206472, 1112036812, 1258750298, -842445917, 1544265955, -1912564262, -620488471, -889282158, 1299296056, 423665295, 1359890860, 1077172953, -73273843, -1659840926, 1392617912, -1081530607, 1303291967, 392392088, -2017022783, 1184793512, -1869570613, -955858860, 340061913, 618379975, 1011823494, -809881216, 1816787957, 1978588983, -1138006003, 2078237231, 1842692073, -620524373, -1715977758, -939991847, 1418466514, 1620817717, 1901794668, -1390883660, 1843164580, 1743133853, 578558002, -1932993837, -858994155, -1461717196, 1528030456, 1435696692, -648559285, -302632139, -1607714348, 223376167, 1711779466, 317524838, -1082127435, -1990228258, -668408596, 548540297, 1651542945, -1614026445, -1832238632, -1037581785, -1523665978, 600270447, -574372648, -763786315, 283393782, 1770243570, -734407698, -1703285931, -327559973, -1788065014, 960709480, -1814854069, -908948374, -436117987, 1682085334, -762279866, -183191368, 220080184, -57766241, -676428704, 1598532481, -1255434042, 1989286800, -1717498989, 1784442077, -1337246483, 1458785475, -1332638305, 145755964, -1074151148, 1287376035, 1362332800, 224035916, -23479538, -1409046242, -694125069, -566762324, -630866531, -347269928, 679566165, 276545043, 366390502, 288394184, -1914964681, -1286440751, -2020552257, 1678295557, -443199195, -1935636633, 2101386234, 818513443, -708582396, 1983248498, -1871954656, -161206170, -1859668546, -1151541471, 988479706, -1460631101, 971904816, -1519785494, -1915212800, -1888967964, -1802228876, -1296777115, 1201309406, -1531584106, 826582647, 118055960, -1132107069, -373631934, -1371339394, -1940516137, 1127749479, 1201351105, 68476456, -1744193508, -306861080, -980025384, -2072230927, -1736978617, 1572698384, 1177367976, -1156123924, 775840687, -1727327625, -38219474, -2063183380, -1110362267, 1684813422, -884896557, 1016574566, 803377337, 540645732, -1240017080, -1178332843, 2034593037, 1429295941, 1034344725, 1381736146, -62446596, -833249209, 1611256781, -1200401518, -518501295, 1572749265, -807863775, -746688917, 1656148124, -1201074141, 922162158, 302308805, 2079850451, 1040750617, 2011035759, 1436256879, 344405547, 1340950393, 1207010603, 1972919535, -2062377130, -975191328, -973132685, -1556578693, 931702417, -1990261158, 35115389, -1650124362, 500851691, -1315688156) 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\", \"activite\""} 
[2026-08-06 15:04:18] local.DEBUG: EmissionQueryBuilder {"context":"App\\Services\\Inventaire\\{closure}","mode":"agg","source_table":"observatoire.agg_epci","filter_level":"epci","display_level":null,"years":[2023],"sql":"select em.year_id, COALESCE(t.name, '(non rattaché)') AS territoire, COALESCE(a.name, '(non rattaché)') AS activite, ROUND((SUM(em.conso_ener_finale_clim_reel_gj)/3.6)::numeric, 2) AS conso_ener_finale_clim_reel_gj from \"observatoire\".\"agg_epci\" as \"em\" left join \"observatoire\".\"dim_territories\" as \"t\" on \"t\".\"id\" = \"em\".\"geo_id\" inner join \"observatoire\".\"dim_activity_memberships\" as \"dtm_a\" on \"dtm_a\".\"activity_id\" = \"em\".\"activity_id\" and \"dtm_a\".\"parent_id\" in (-622080275, 208862058, 74904297, 1926750763, 1705942411, -273970232, -1732845089, 14022040) inner join \"observatoire\".\"dim_activities\" as \"a\" on \"a\".\"id\" = \"dtm_a\".\"parent_id\" where \"em\".\"year_id\" in (2023) and \"em\".\"geo_id\" in (-2074645457) and \"em\".\"activity_id\" in (-2065015321, 1664202072, -1468143007, 1108698765, -697951920, 53616376, 911083398, -2129813176, -1918263047, -393206791, 562718587, 439277546, -858228785, 1839125859, 1824025864, 254468532, 1735525248, 240491429, 751538419, 1662919374, 1660135024, -2109039919, 97436677, -124660711, -1987478087, 722905366, -93516697, -818258464, -1982109166, 1409930224, -2034818798, 1822307428, -1758060949, 155019705, 1869212529, -609915394, 1481894613, 1395794963, 1695347196, 64335092, 921165895, -142018260, -482664252, 26668268, 942433737, 2101539831, -556896478, -289004236, 1180149453, -1100601087, 2113546912, -1166060768, -1270919973, 1741715211, -604604043, -1323823743, -65650287, -1771225083, 556015237, -497458774, 1890006254, -717879577, -475198975, 1306594475, 1087885866, -893165577, -1618922050, 409891242, -2075398489, 865842982, 1765509547, -1487210095, 76265396, 503239948, 1329377505, -2004721785, -1859723360, 1648387281, -731418973, -924061465, -519499276, -1689620327, 571578548, 1372013544, -2017652732, 506491597, 333711349, -1807500046, 680092381, 28083642, 879051533, -1167947622, 1900723648, -198132915, -567369811, 1273925006, 719954458, 1659802002, -1605866945, 1251539306, -1246034248, -2000350303, 122587945, 1855887801, 1307996793, -797747832, 1915345643, -719653191, -574407755, 747285232, 1757275487, 1312649538, 660808751, 1444864905, 82030098, 937605621, -1352377836, -407252425, 1763501654, -1405923019, 350725182, 1824837113, -1560607589, 682492730, 1303189715, 1734631443, 1243082219, 1140080948, -966852427, -632337157, 1663741761, -567757160, -1887790066, -837308181, -1623725498, -1436585389, -248116745, 2079193929, 1285586024, -1749430722, -717359299, -98448292, -853873446, -762838756, 1974523832, -1736763325, 859934642, 760580929, 1658855321, 138601578, 1153344103, 1280935296, -1951484904, 725270159, -1104146686, -225028528, -469721241, -1445420861, -2104684761, -1259394394, 1942080707, -913831972, 350561514, 1206983340, 1633334487, -1017289816, -843932025, -337017078, 454621909, 41079158, -1846591393, 804338617, 1352484195, 1426270099, -1732290900, 1353783048, -1078990055, -307626332, 2128833364, 1054770029, -740347188, -1430328674, 730376509, 504001257, -1859749546, -435776990, -2102767552, -933330074, 112476696, -446796902, -1546313589, 1663401832, 1104829866, -323474854, 906942419, -2009648112, -1608512036, 489987876, 301093584, 1663410790, -820564035, 1066750091, 2110173394, -2048915241, 859987309, 1134610842, -1219234331, 1099679168, 1855856603, -964500217, 21511964, 1388087176, 1967813158, -1063238036, -570672305, 2106414096, 1913359952, -2145734036, 342527500, 429059437, -295738415, -376271361, 827134186, 2047409618, 1519990054, -1487774563, 153764150, 1371033649, 776279000, 692870153, -1951358321, -889255393, 905336003, -1528757905, -1313144583, -189572407, 1219243506, -1959662381, -667330531, -1327037360, -388600018, -1768991392, 631501363, 1428443613, -794523335, -921669000, 50809254, -1151061648, -263558204, -1316167746, 254882134, -1432964826, 971161973, -869291431, -92274995, 2001828071, 717533312, -919698739, -115032065, -1710809284, 1440646841, 438839785, 1838130794, -1438657658, -2100037337, -1645230407, -35163706, -244693147, 747547873, -178006637, -316787613, -1609021450, 425592013, 1142721112, 1125960239, 342687363, -715496447, -466654990, -22267807, 2004972987, 373557710, -538767368, -583628804, 1231105243, -148499659, -1978708979, 1035684050, 595015853, 1713779118, 530155604, 1319740754, -1878882180, -578878727, 46178169, 1173150921, 707403387, 595454509, 2093595260, -178885722, 1933574569, 1689971204, 2099170107, -23642967, -893109849, -394754806, -1052690536, 373550100, -1337323363, 1447225472, 1276215965, 33249239, 730336352, -639410621, 932667705, -1839258623, 1911698987, -37699356, -982013561, -1459018491, -883327242, 1252179801, -450105656, -799071091, -1118403434, -432827018, -2125877781, -1464392700, -1334310062, 1371610371, -1652853783, 2106513667, -1320908412, -1981687934, 1764341119, -457559919, -1414713643, -394200259, -1573937312, -1087220802, 1173327443, 1942963054, -1193483522, 575519546, 1411111401, -50696485, -390568655, -1496086086, -273047452, 1578846294, -1189987097, -366685926, -390542442, 310956635, 494216435, -1591836854, -1958561345, 2001630306, -1144004711, 942233085, -1824930634, -35558533, -1345162752, 1713162907, -600367835, -1294709678, -356747582, -761498023, -1171478393, -487172781, -1805861555, 1024219564, 579293477, 1140113838, -1419278172, 2024238092, -182420025, -1904591798, 2117082238, 1974281097, -1743267982, -919487101, -770400240, -1939219148, 1687214361, -543242059, 1687613177, 692025924, 1949554747, -1071587566, 216692383, -1231239857, -301100043, 1184608045, 1570062812, 1744165561, -2024511393, -2117292693, -183910117, -1210454800, 933754793, 1924478818, 1584015331, -1929400904, -1865280307, 589008399, -125964541, 1640238785, -1829002824, 1898736760, 2108532170, 1044726750, 1923261691, 1227983953, -1363934197, 384410393, -2044885611, 919914692, 736532642, -1239747894, -1632648707, 2134862632, 1386497909, -1028097404, -1390684557, 2139709518, -1273156420, 1222056809, 539391017, 515802054, -2129230707, -1408995398, 632880332, 1772504308, -966063115, -1799725714, 21937287, 1477165581, 1253744553, 203783501, 1236677003, 689872, 1075533786, 1649769611, -97814566, -337441085, 675577244, 1367391544, 1379603351, 1049700765, 847335499, -14567500, -118886754, 1563060129, -1287483713, 1574055369, -1513139721, -1389614002, -1144038162, 775868583, -606258386, -1987052516, 1855178673, -2044004547, -1581253380, 1201608055, 85619372, -68842748, -1279064480, 2005250983, -307341145, 1996142013, 375123593, -271055130, -1781860008, 1096813866, 1849745898, 1007707851, -1605275342, -2140441286, 739923250, -704377305, -467115791, 1079222860, 242615640, -1837178453, 318613241, 347811431, -197558611, -2019686765, -980556544, 1553348267, 494206472, 1112036812, 1258750298, -842445917, 1544265955, -1912564262, -620488471, -889282158, 1299296056, 423665295, 1359890860, 1077172953, -73273843, -1659840926, 1392617912, -1081530607, 1303291967, 392392088, -2017022783, 1184793512, -1869570613, -955858860, 340061913, 618379975, 1011823494, -809881216, 1816787957, 1978588983, -1138006003, 2078237231, 1842692073, -620524373, -1715977758, -939991847, 1418466514, 1620817717, 1901794668, -1390883660, 1843164580, 1743133853, 578558002, -1932993837, -858994155, -1461717196, 1528030456, 1435696692, -648559285, -302632139, -1607714348, 223376167, 1711779466, 317524838, -1082127435, -1990228258, -668408596, 548540297, 1651542945, -1614026445, -1832238632, -1037581785, -1523665978, 600270447, -574372648, -763786315, 283393782, 1770243570, -734407698, -1703285931, -327559973, -1788065014, 960709480, -1814854069, -908948374, -436117987, 1682085334, -762279866, -183191368, 220080184, -57766241, -676428704, 1598532481, -1255434042, 1989286800, -1717498989, 1784442077, -1337246483, 1458785475, -1332638305, 145755964, -1074151148, 1287376035, 1362332800, 224035916, -23479538, -1409046242, -694125069, -566762324, -630866531, -347269928, 679566165, 276545043, 366390502, 288394184, -1914964681, -1286440751, -2020552257, 1678295557, -443199195, -1935636633, 2101386234, 818513443, -708582396, 1983248498, -1871954656, -161206170, -1859668546, -1151541471, 988479706, -1460631101, 971904816, -1519785494, -1915212800, -1888967964, -1802228876, -1296777115, 1201309406, -1531584106, 826582647, 118055960, -1132107069, -373631934, -1371339394, -1940516137, 1127749479, 1201351105, 68476456, -1744193508, -306861080, -980025384, -2072230927, -1736978617, 1572698384, 1177367976, -1156123924, 775840687, -1727327625, -38219474, -2063183380, -1110362267, 1684813422, -884896557, 1016574566, 803377337, 540645732, -1240017080, -1178332843, 2034593037, 1429295941, 1034344725, 1381736146, -62446596, -833249209, 1611256781, -1200401518, -518501295, 1572749265, -807863775, -746688917, 1656148124, -1201074141, 922162158, 302308805, 2079850451, 1040750617, 2011035759, 1436256879, 344405547, 1340950393, 1207010603, 1972919535, -2062377130, -975191328, -973132685, -1556578693, 931702417, -1990261158, 35115389, -1650124362, 500851691, -1315688156) 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\", \"activite\""} 
[2026-08-06 15:04:18] local.DEBUG: EmissionQueryBuilder {"context":"App\\Services\\Inventaire\\{closure}","mode":"agg","source_table":"observatoire.agg_epci","filter_level":"epci","display_level":null,"years":[2023],"sql":"select em.year_id, COALESCE(t.name, '(non rattaché)') AS territoire, COALESCE(a.name, '(non rattaché)') AS activite, ROUND((SUM(em.conso_ener_finale_clim_reel_gj)/3.6)::numeric, 2) AS conso_ener_finale_clim_reel_gj from \"observatoire\".\"agg_epci\" as \"em\" left join \"observatoire\".\"dim_territories\" as \"t\" on \"t\".\"id\" = \"em\".\"geo_id\" inner join \"observatoire\".\"dim_activity_memberships\" as \"dtm_a\" on \"dtm_a\".\"activity_id\" = \"em\".\"activity_id\" and \"dtm_a\".\"parent_id\" in (-622080275, 208862058, 74904297, 1926750763, 1705942411, -273970232, -1732845089, 14022040) inner join \"observatoire\".\"dim_activities\" as \"a\" on \"a\".\"id\" = \"dtm_a\".\"parent_id\" where \"em\".\"year_id\" in (2023) and \"em\".\"geo_id\" in (-2074645457) and \"em\".\"activity_id\" in (-2065015321, 1664202072, -1468143007, 1108698765, -697951920, 53616376, 911083398, -2129813176, -1918263047, -393206791, 562718587, 439277546, -858228785, 1839125859, 1824025864, 254468532, 1735525248, 240491429, 751538419, 1662919374, 1660135024, -2109039919, 97436677, -124660711, -1987478087, 722905366, -93516697, -818258464, -1982109166, 1409930224, -2034818798, 1822307428, -1758060949, 155019705, 1869212529, -609915394, 1481894613, 1395794963, 1695347196, 64335092, 921165895, -142018260, -482664252, 26668268, 942433737, 2101539831, -556896478, -289004236, 1180149453, -1100601087, 2113546912, -1166060768, -1270919973, 1741715211, -604604043, -1323823743, -65650287, -1771225083, 556015237, -497458774, 1890006254, -717879577, -475198975, 1306594475, 1087885866, -893165577, -1618922050, 409891242, -2075398489, 865842982, 1765509547, -1487210095, 76265396, 503239948, 1329377505, -2004721785, -1859723360, 1648387281, -731418973, -924061465, -519499276, -1689620327, 571578548, 1372013544, -2017652732, 506491597, 333711349, -1807500046, 680092381, 28083642, 879051533, -1167947622, 1900723648, -198132915, -567369811, 1273925006, 719954458, 1659802002, -1605866945, 1251539306, -1246034248, -2000350303, 122587945, 1855887801, 1307996793, -797747832, 1915345643, -719653191, -574407755, 747285232, 1757275487, 1312649538, 660808751, 1444864905, 82030098, 937605621, -1352377836, -407252425, 1763501654, -1405923019, 350725182, 1824837113, -1560607589, 682492730, 1303189715, 1734631443, 1243082219, 1140080948, -966852427, -632337157, 1663741761, -567757160, -1887790066, -837308181, -1623725498, -1436585389, -248116745, 2079193929, 1285586024, -1749430722, -717359299, -98448292, -853873446, -762838756, 1974523832, -1736763325, 859934642, 760580929, 1658855321, 138601578, 1153344103, 1280935296, -1951484904, 725270159, -1104146686, -225028528, -469721241, -1445420861, -2104684761, -1259394394, 1942080707, -913831972, 350561514, 1206983340, 1633334487, -1017289816, -843932025, -337017078, 454621909, 41079158, -1846591393, 804338617, 1352484195, 1426270099, -1732290900, 1353783048, -1078990055, -307626332, 2128833364, 1054770029, -740347188, -1430328674, 730376509, 504001257, -1859749546, -435776990, -2102767552, -933330074, 112476696, -446796902, -1546313589, 1663401832, 1104829866, -323474854, 906942419, -2009648112, -1608512036, 489987876, 301093584, 1663410790, -820564035, 1066750091, 2110173394, -2048915241, 859987309, 1134610842, -1219234331, 1099679168, 1855856603, -964500217, 21511964, 1388087176, 1967813158, -1063238036, -570672305, 2106414096, 1913359952, -2145734036, 342527500, 429059437, -295738415, -376271361, 827134186, 2047409618, 1519990054, -1487774563, 153764150, 1371033649, 776279000, 692870153, -1951358321, -889255393, 905336003, -1528757905, -1313144583, -189572407, 1219243506, -1959662381, -667330531, -1327037360, -388600018, -1768991392, 631501363, 1428443613, -794523335, -921669000, 50809254, -1151061648, -263558204, -1316167746, 254882134, -1432964826, 971161973, -869291431, -92274995, 2001828071, 717533312, -919698739, -115032065, -1710809284, 1440646841, 438839785, 1838130794, -1438657658, -2100037337, -1645230407, -35163706, -244693147, 747547873, -178006637, -316787613, -1609021450, 425592013, 1142721112, 1125960239, 342687363, -715496447, -466654990, -22267807, 2004972987, 373557710, -538767368, -583628804, 1231105243, -148499659, -1978708979, 1035684050, 595015853, 1713779118, 530155604, 1319740754, -1878882180, -578878727, 46178169, 1173150921, 707403387, 595454509, 2093595260, -178885722, 1933574569, 1689971204, 2099170107, -23642967, -893109849, -394754806, -1052690536, 373550100, -1337323363, 1447225472, 1276215965, 33249239, 730336352, -639410621, 932667705, -1839258623, 1911698987, -37699356, -982013561, -1459018491, -883327242, 1252179801, -450105656, -799071091, -1118403434, -432827018, -2125877781, -1464392700, -1334310062, 1371610371, -1652853783, 2106513667, -1320908412, -1981687934, 1764341119, -457559919, -1414713643, -394200259, -1573937312, -1087220802, 1173327443, 1942963054, -1193483522, 575519546, 1411111401, -50696485, -390568655, -1496086086, -273047452, 1578846294, -1189987097, -366685926, -390542442, 310956635, 494216435, -1591836854, -1958561345, 2001630306, -1144004711, 942233085, -1824930634, -35558533, -1345162752, 1713162907, -600367835, -1294709678, -356747582, -761498023, -1171478393, -487172781, -1805861555, 1024219564, 579293477, 1140113838, -1419278172, 2024238092, -182420025, -1904591798, 2117082238, 1974281097, -1743267982, -919487101, -770400240, -1939219148, 1687214361, -543242059, 1687613177, 692025924, 1949554747, -1071587566, 216692383, -1231239857, -301100043, 1184608045, 1570062812, 1744165561, -2024511393, -2117292693, -183910117, -1210454800, 933754793, 1924478818, 1584015331, -1929400904, -1865280307, 589008399, -125964541, 1640238785, -1829002824, 1898736760, 2108532170, 1044726750, 1923261691, 1227983953, -1363934197, 384410393, -2044885611, 919914692, 736532642, -1239747894, -1632648707, 2134862632, 1386497909, -1028097404, -1390684557, 2139709518, -1273156420, 1222056809, 539391017, 515802054, -2129230707, -1408995398, 632880332, 1772504308, -966063115, -1799725714, 21937287, 1477165581, 1253744553, 203783501, 1236677003, 689872, 1075533786, 1649769611, -97814566, -337441085, 675577244, 1367391544, 1379603351, 1049700765, 847335499, -14567500, -118886754, 1563060129, -1287483713, 1574055369, -1513139721, -1389614002, -1144038162, 775868583, -606258386, -1987052516, 1855178673, -2044004547, -1581253380, 1201608055, 85619372, -68842748, -1279064480, 2005250983, -307341145, 1996142013, 375123593, -271055130, -1781860008, 1096813866, 1849745898, 1007707851, -1605275342, -2140441286, 739923250, -704377305, -467115791, 1079222860, 242615640, -1837178453, 318613241, 347811431, -197558611, -2019686765, -980556544, 1553348267, 494206472, 1112036812, 1258750298, -842445917, 1544265955, -1912564262, -620488471, -889282158, 1299296056, 423665295, 1359890860, 1077172953, -73273843, -1659840926, 1392617912, -1081530607, 1303291967, 392392088, -2017022783, 1184793512, -1869570613, -955858860, 340061913, 618379975, 1011823494, -809881216, 1816787957, 1978588983, -1138006003, 2078237231, 1842692073, -620524373, -1715977758, -939991847, 1418466514, 1620817717, 1901794668, -1390883660, 1843164580, 1743133853, 578558002, -1932993837, -858994155, -1461717196, 1528030456, 1435696692, -648559285, -302632139, -1607714348, 223376167, 1711779466, 317524838, -1082127435, -1990228258, -668408596, 548540297, 1651542945, -1614026445, -1832238632, -1037581785, -1523665978, 600270447, -574372648, -763786315, 283393782, 1770243570, -734407698, -1703285931, -327559973, -1788065014, 960709480, -1814854069, -908948374, -436117987, 1682085334, -762279866, -183191368, 220080184, -57766241, -676428704, 1598532481, -1255434042, 1989286800, -1717498989, 1784442077, -1337246483, 1458785475, -1332638305, 145755964, -1074151148, 1287376035, 1362332800, 224035916, -23479538, -1409046242, -694125069, -566762324, -630866531, -347269928, 679566165, 276545043, 366390502, 288394184, -1914964681, -1286440751, -2020552257, 1678295557, -443199195, -1935636633, 2101386234, 818513443, -708582396, 1983248498, -1871954656, -161206170, -1859668546, -1151541471, 988479706, -1460631101, 971904816, -1519785494, -1915212800, -1888967964, -1802228876, -1296777115, 1201309406, -1531584106, 826582647, 118055960, -1132107069, -373631934, -1371339394, -1940516137, 1127749479, 1201351105, 68476456, -1744193508, -306861080, -980025384, -2072230927, -1736978617, 1572698384, 1177367976, -1156123924, 775840687, -1727327625, -38219474, -2063183380, -1110362267, 1684813422, -884896557, 1016574566, 803377337, 540645732, -1240017080, -1178332843, 2034593037, 1429295941, 1034344725, 1381736146, -62446596, -833249209, 1611256781, -1200401518, -518501295, 1572749265, -807863775, -746688917, 1656148124, -1201074141, 922162158, 302308805, 2079850451, 1040750617, 2011035759, 1436256879, 344405547, 1340950393, 1207010603, 1972919535, -2062377130, -975191328, -973132685, -1556578693, 931702417, -1990261158, 35115389, -1650124362, 500851691, -1315688156) 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\", \"activite\""} 
[2026-08-06 15:10:29] local.DEBUG: EmissionQueryBuilder {"context":"App\\Services\\Inventaire\\{closure}","mode":"agg","source_table":"observatoire.agg_epci","filter_level":"epci","display_level":null,"years":[2023,2024,2022,2021,2020,2019,2018,2017,2016,2015,2014,2012,2010,1990,2005],"sql":"select em.year_id, COALESCE(t.name, '(non rattaché)') AS territoire, COALESCE(a.name, '(non rattaché)') AS activite, ROUND((SUM(em.conso_ener_finale_clim_normal_gj)/3.6)::numeric, 2) AS conso_ener_finale_clim_normal_gj, ROUND(SUM(em.pm10_kg)::numeric, 4) AS pm10_kg, ROUND(SUM(em.pm2_5_kg)::numeric, 4) AS pm2_5_kg, ROUND(SUM(em.nox_kg)::numeric, 4) AS nox_kg, ROUND(SUM(em.prg_2021_teqco2_pcaet)::numeric, 4) AS prg_2021_teqco2_pcaet, ROUND((SUM(em.conso_ener_finale_clim_reel_gj)/3.6)::numeric, 2) AS conso_ener_finale_clim_reel_gj from \"observatoire\".\"agg_epci\" as \"em\" left join \"observatoire\".\"dim_territories\" as \"t\" on \"t\".\"id\" = \"em\".\"geo_id\" inner join \"observatoire\".\"dim_activity_memberships\" as \"dtm_a\" on \"dtm_a\".\"activity_id\" = \"em\".\"activity_id\" and \"dtm_a\".\"parent_id\" in (-622080275, 208862058, 74904297, 1926750763, 1705942411, -273970232, -1732845089, 14022040) inner join \"observatoire\".\"dim_activities\" as \"a\" on \"a\".\"id\" = \"dtm_a\".\"parent_id\" where \"em\".\"year_id\" in (2023, 2024, 2022, 2021, 2020, 2019, 2018, 2017, 2016, 2015, 2014, 2012, 2010, 1990, 2005) and \"em\".\"geo_id\" in (-2074645457) and \"em\".\"activity_id\" in (-2065015321, 1664202072, -1468143007, 1108698765, -697951920, 53616376, 911083398, -2129813176, -1918263047, -393206791, 562718587, 439277546, -858228785, 1839125859, 1824025864, 254468532, 1735525248, 240491429, 751538419, 1662919374, 1660135024, -2109039919, 97436677, -124660711, -1987478087, 722905366, -93516697, -818258464, -1982109166, 1409930224, -2034818798, 1822307428, -1758060949, 155019705, 1869212529, -609915394, 1481894613, 1395794963, 1695347196, 64335092, 921165895, -142018260, -482664252, 26668268, 942433737, 2101539831, -556896478, -289004236, 1180149453, -1100601087, 2113546912, -1166060768, -1270919973, 1741715211, -604604043, -1323823743, -65650287, -1771225083, 556015237, -497458774, 1890006254, -717879577, -475198975, 1306594475, 1087885866, -893165577, -1618922050, 409891242, -2075398489, 865842982, 1765509547, -1487210095, 76265396, 503239948, 1329377505, -2004721785, -1859723360, 1648387281, -731418973, -924061465, -519499276, -1689620327, 571578548, 1372013544, -2017652732, 506491597, 333711349, -1807500046, 680092381, 28083642, 879051533, -1167947622, 1900723648, -198132915, -567369811, 1273925006, 719954458, 1659802002, -1605866945, 1251539306, -1246034248, -2000350303, 122587945, 1855887801, 1307996793, -797747832, 1915345643, -719653191, -574407755, 747285232, 1757275487, 1312649538, 660808751, 1444864905, 82030098, 937605621, -1352377836, -407252425, 1763501654, -1405923019, 350725182, 1824837113, -1560607589, 682492730, 1303189715, 1734631443, 1243082219, 1140080948, -966852427, -632337157, 1663741761, -567757160, -1887790066, -837308181, -1623725498, -1436585389, -248116745, 2079193929, 1285586024, -1749430722, -717359299, -98448292, -853873446, -762838756, 1974523832, -1736763325, 859934642, 760580929, 1658855321, 138601578, 1153344103, 1280935296, -1951484904, 725270159, -1104146686, -225028528, -469721241, -1445420861, -2104684761, -1259394394, 1942080707, -913831972, 350561514, 1206983340, 1633334487, -1017289816, -843932025, -337017078, 454621909, 41079158, -1846591393, 804338617, 1352484195, 1426270099, -1732290900, 1353783048, -1078990055, -307626332, 2128833364, 1054770029, -740347188, -1430328674, 730376509, 504001257, -1859749546, -435776990, -2102767552, -933330074, 112476696, -446796902, -1546313589, 1663401832, 1104829866, -323474854, 906942419, -2009648112, -1608512036, 489987876, 301093584, 1663410790, -820564035, 1066750091, 2110173394, -2048915241, 859987309, 1134610842, -1219234331, 1099679168, 1855856603, -964500217, 21511964, 1388087176, 1967813158, -1063238036, -570672305, 2106414096, 1913359952, -2145734036, 342527500, 429059437, -295738415, -376271361, 827134186, 2047409618, 1519990054, -1487774563, 153764150, 1371033649, 776279000, 692870153, -1951358321, -889255393, 905336003, -1528757905, -1313144583, -189572407, 1219243506, -1959662381, -667330531, -1327037360, -388600018, -1768991392, 631501363, 1428443613, -794523335, -921669000, 50809254, -1151061648, -263558204, -1316167746, 254882134, -1432964826, 971161973, -869291431, -92274995, 2001828071, 717533312, -919698739, -115032065, -1710809284, 1440646841, 438839785, 1838130794, -1438657658, -2100037337, -1645230407, -35163706, -244693147, 747547873, -178006637, -316787613, -1609021450, 425592013, 1142721112, 1125960239, 342687363, -715496447, -466654990, -22267807, 2004972987, 373557710, -538767368, -583628804, 1231105243, -148499659, -1978708979, 1035684050, 595015853, 1713779118, 530155604, 1319740754, -1878882180, -578878727, 46178169, 1173150921, 707403387, 595454509, 2093595260, -178885722, 1933574569, 1689971204, 2099170107, -23642967, -893109849, -394754806, -1052690536, 373550100, -1337323363, 1447225472, 1276215965, 33249239, 730336352, -639410621, 932667705, -1839258623, 1911698987, -37699356, -982013561, -1459018491, -883327242, 1252179801, -450105656, -799071091, -1118403434, -432827018, -2125877781, -1464392700, -1334310062, 1371610371, -1652853783, 2106513667, -1320908412, -1981687934, 1764341119, -457559919, -1414713643, -394200259, -1573937312, -1087220802, 1173327443, 1942963054, -1193483522, 575519546, 1411111401, -50696485, -390568655, -1496086086, -273047452, 1578846294, -1189987097, -366685926, -390542442, 310956635, 494216435, -1591836854, -1958561345, 2001630306, -1144004711, 942233085, -1824930634, -35558533, -1345162752, 1713162907, -600367835, -1294709678, -356747582, -761498023, -1171478393, -487172781, -1805861555, 1024219564, 579293477, 1140113838, -1419278172, 2024238092, -182420025, -1904591798, 2117082238, 1974281097, -1743267982, -919487101, -770400240, -1939219148, 1687214361, -543242059, 1687613177, 692025924, 1949554747, -1071587566, 216692383, -1231239857, -301100043, 1184608045, 1570062812, 1744165561, -2024511393, -2117292693, -183910117, -1210454800, 933754793, 1924478818, 1584015331, -1929400904, -1865280307, 589008399, -125964541, 1640238785, -1829002824, 1898736760, 2108532170, 1044726750, 1923261691, 1227983953, -1363934197, 384410393, -2044885611, 919914692, 736532642, -1239747894, -1632648707, 2134862632, 1386497909, -1028097404, -1390684557, 2139709518, -1273156420, 1222056809, 539391017, 515802054, -2129230707, -1408995398, 632880332, 1772504308, -966063115, -1799725714, 21937287, 1477165581, 1253744553, 203783501, 1236677003, 689872, 1075533786, 1649769611, -97814566, -337441085, 675577244, 1367391544, 1379603351, 1049700765, 847335499, -14567500, -118886754, 1563060129, -1287483713, 1574055369, -1513139721, -1389614002, -1144038162, 775868583, -606258386, -1987052516, 1855178673, -2044004547, -1581253380, 1201608055, 85619372, -68842748, -1279064480, 2005250983, -307341145, 1996142013, 375123593, -271055130, -1781860008, 1096813866, 1849745898, 1007707851, -1605275342, -2140441286, 739923250, -704377305, -467115791, 1079222860, 242615640, -1837178453, 318613241, 347811431, -197558611, -2019686765, -980556544, 1553348267, 494206472, 1112036812, 1258750298, -842445917, 1544265955, -1912564262, -620488471, -889282158, 1299296056, 423665295, 1359890860, 1077172953, -73273843, -1659840926, 1392617912, -1081530607, 1303291967, 392392088, -2017022783, 1184793512, -1869570613, -955858860, 340061913, 618379975, 1011823494, -809881216, 1816787957, 1978588983, -1138006003, 2078237231, 1842692073, -620524373, -1715977758, -939991847, 1418466514, 1620817717, 1901794668, -1390883660, 1843164580, 1743133853, 578558002, -1932993837, -858994155, -1461717196, 1528030456, 1435696692, -648559285, -302632139, -1607714348, 223376167, 1711779466, 317524838, -1082127435, -1990228258, -668408596, 548540297, 1651542945, -1614026445, -1832238632, -1037581785, -1523665978, 600270447, -574372648, -763786315, 283393782, 1770243570, -734407698, -1703285931, -327559973, -1788065014, 960709480, -1814854069, -908948374, -436117987, 1682085334, -762279866, -183191368, 220080184, -57766241, -676428704, 1598532481, -1255434042, 1989286800, -1717498989, 1784442077, -1337246483, 1458785475, -1332638305, 145755964, -1074151148, 1287376035, 1362332800, 224035916, -23479538, -1409046242, -694125069, -566762324, -630866531, -347269928, 679566165, 276545043, 366390502, 288394184, -1914964681, -1286440751, -2020552257, 1678295557, -443199195, -1935636633, 2101386234, 818513443, -708582396, 1983248498, -1871954656, -161206170, -1859668546, -1151541471, 988479706, -1460631101, 971904816, -1519785494, -1915212800, -1888967964, -1802228876, -1296777115, 1201309406, -1531584106, 826582647, 118055960, -1132107069, -373631934, -1371339394, -1940516137, 1127749479, 1201351105, 68476456, -1744193508, -306861080, -980025384, -2072230927, -1736978617, 1572698384, 1177367976, -1156123924, 775840687, -1727327625, -38219474, -2063183380, -1110362267, 1684813422, -884896557, 1016574566, 803377337, 540645732, -1240017080, -1178332843, 2034593037, 1429295941, 1034344725, 1381736146, -62446596, -833249209, 1611256781, -1200401518, -518501295, 1572749265, -807863775, -746688917, 1656148124, -1201074141, 922162158, 302308805, 2079850451, 1040750617, 2011035759, 1436256879, 344405547, 1340950393, 1207010603, 1972919535, -2062377130, -975191328, -973132685, -1556578693, 931702417, -1990261158, 35115389, -1650124362, 500851691, -1315688156) 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\", \"activite\""} 
[2026-08-06 15:10:29] local.DEBUG: EmissionQueryBuilder {"context":"App\\Services\\Inventaire\\{closure}","mode":"agg","source_table":"observatoire.agg_epci","filter_level":"epci","display_level":null,"years":[2023,2024,2022,2021,2020,2019,2018,2017,2016,2015,2014,2012,2010,1990,2005],"sql":"select em.year_id, COALESCE(t.name, '(non rattaché)') AS territoire, COALESCE(a.name, '(non rattaché)') AS activite, ROUND((SUM(em.conso_ener_finale_clim_normal_gj)/3.6)::numeric, 2) AS conso_ener_finale_clim_normal_gj, ROUND(SUM(em.pm10_kg)::numeric, 4) AS pm10_kg, ROUND(SUM(em.pm2_5_kg)::numeric, 4) AS pm2_5_kg, ROUND(SUM(em.nox_kg)::numeric, 4) AS nox_kg, ROUND(SUM(em.prg_2021_teqco2_pcaet)::numeric, 4) AS prg_2021_teqco2_pcaet, ROUND((SUM(em.conso_ener_finale_clim_reel_gj)/3.6)::numeric, 2) AS conso_ener_finale_clim_reel_gj from \"observatoire\".\"agg_epci\" as \"em\" left join \"observatoire\".\"dim_territories\" as \"t\" on \"t\".\"id\" = \"em\".\"geo_id\" inner join \"observatoire\".\"dim_activity_memberships\" as \"dtm_a\" on \"dtm_a\".\"activity_id\" = \"em\".\"activity_id\" and \"dtm_a\".\"parent_id\" in (-622080275, 208862058, 74904297, 1926750763, 1705942411, -273970232, -1732845089, 14022040) inner join \"observatoire\".\"dim_activities\" as \"a\" on \"a\".\"id\" = \"dtm_a\".\"parent_id\" where \"em\".\"year_id\" in (2023, 2024, 2022, 2021, 2020, 2019, 2018, 2017, 2016, 2015, 2014, 2012, 2010, 1990, 2005) and \"em\".\"geo_id\" in (-2074645457) and \"em\".\"activity_id\" in (-2065015321, 1664202072, -1468143007, 1108698765, -697951920, 53616376, 911083398, -2129813176, -1918263047, -393206791, 562718587, 439277546, -858228785, 1839125859, 1824025864, 254468532, 1735525248, 240491429, 751538419, 1662919374, 1660135024, -2109039919, 97436677, -124660711, -1987478087, 722905366, -93516697, -818258464, -1982109166, 1409930224, -2034818798, 1822307428, -1758060949, 155019705, 1869212529, -609915394, 1481894613, 1395794963, 1695347196, 64335092, 921165895, -142018260, -482664252, 26668268, 942433737, 2101539831, -556896478, -289004236, 1180149453, -1100601087, 2113546912, -1166060768, -1270919973, 1741715211, -604604043, -1323823743, -65650287, -1771225083, 556015237, -497458774, 1890006254, -717879577, -475198975, 1306594475, 1087885866, -893165577, -1618922050, 409891242, -2075398489, 865842982, 1765509547, -1487210095, 76265396, 503239948, 1329377505, -2004721785, -1859723360, 1648387281, -731418973, -924061465, -519499276, -1689620327, 571578548, 1372013544, -2017652732, 506491597, 333711349, -1807500046, 680092381, 28083642, 879051533, -1167947622, 1900723648, -198132915, -567369811, 1273925006, 719954458, 1659802002, -1605866945, 1251539306, -1246034248, -2000350303, 122587945, 1855887801, 1307996793, -797747832, 1915345643, -719653191, -574407755, 747285232, 1757275487, 1312649538, 660808751, 1444864905, 82030098, 937605621, -1352377836, -407252425, 1763501654, -1405923019, 350725182, 1824837113, -1560607589, 682492730, 1303189715, 1734631443, 1243082219, 1140080948, -966852427, -632337157, 1663741761, -567757160, -1887790066, -837308181, -1623725498, -1436585389, -248116745, 2079193929, 1285586024, -1749430722, -717359299, -98448292, -853873446, -762838756, 1974523832, -1736763325, 859934642, 760580929, 1658855321, 138601578, 1153344103, 1280935296, -1951484904, 725270159, -1104146686, -225028528, -469721241, -1445420861, -2104684761, -1259394394, 1942080707, -913831972, 350561514, 1206983340, 1633334487, -1017289816, -843932025, -337017078, 454621909, 41079158, -1846591393, 804338617, 1352484195, 1426270099, -1732290900, 1353783048, -1078990055, -307626332, 2128833364, 1054770029, -740347188, -1430328674, 730376509, 504001257, -1859749546, -435776990, -2102767552, -933330074, 112476696, -446796902, -1546313589, 1663401832, 1104829866, -323474854, 906942419, -2009648112, -1608512036, 489987876, 301093584, 1663410790, -820564035, 1066750091, 2110173394, -2048915241, 859987309, 1134610842, -1219234331, 1099679168, 1855856603, -964500217, 21511964, 1388087176, 1967813158, -1063238036, -570672305, 2106414096, 1913359952, -2145734036, 342527500, 429059437, -295738415, -376271361, 827134186, 2047409618, 1519990054, -1487774563, 153764150, 1371033649, 776279000, 692870153, -1951358321, -889255393, 905336003, -1528757905, -1313144583, -189572407, 1219243506, -1959662381, -667330531, -1327037360, -388600018, -1768991392, 631501363, 1428443613, -794523335, -921669000, 50809254, -1151061648, -263558204, -1316167746, 254882134, -1432964826, 971161973, -869291431, -92274995, 2001828071, 717533312, -919698739, -115032065, -1710809284, 1440646841, 438839785, 1838130794, -1438657658, -2100037337, -1645230407, -35163706, -244693147, 747547873, -178006637, -316787613, -1609021450, 425592013, 1142721112, 1125960239, 342687363, -715496447, -466654990, -22267807, 2004972987, 373557710, -538767368, -583628804, 1231105243, -148499659, -1978708979, 1035684050, 595015853, 1713779118, 530155604, 1319740754, -1878882180, -578878727, 46178169, 1173150921, 707403387, 595454509, 2093595260, -178885722, 1933574569, 1689971204, 2099170107, -23642967, -893109849, -394754806, -1052690536, 373550100, -1337323363, 1447225472, 1276215965, 33249239, 730336352, -639410621, 932667705, -1839258623, 1911698987, -37699356, -982013561, -1459018491, -883327242, 1252179801, -450105656, -799071091, -1118403434, -432827018, -2125877781, -1464392700, -1334310062, 1371610371, -1652853783, 2106513667, -1320908412, -1981687934, 1764341119, -457559919, -1414713643, -394200259, -1573937312, -1087220802, 1173327443, 1942963054, -1193483522, 575519546, 1411111401, -50696485, -390568655, -1496086086, -273047452, 1578846294, -1189987097, -366685926, -390542442, 310956635, 494216435, -1591836854, -1958561345, 2001630306, -1144004711, 942233085, -1824930634, -35558533, -1345162752, 1713162907, -600367835, -1294709678, -356747582, -761498023, -1171478393, -487172781, -1805861555, 1024219564, 579293477, 1140113838, -1419278172, 2024238092, -182420025, -1904591798, 2117082238, 1974281097, -1743267982, -919487101, -770400240, -1939219148, 1687214361, -543242059, 1687613177, 692025924, 1949554747, -1071587566, 216692383, -1231239857, -301100043, 1184608045, 1570062812, 1744165561, -2024511393, -2117292693, -183910117, -1210454800, 933754793, 1924478818, 1584015331, -1929400904, -1865280307, 589008399, -125964541, 1640238785, -1829002824, 1898736760, 2108532170, 1044726750, 1923261691, 1227983953, -1363934197, 384410393, -2044885611, 919914692, 736532642, -1239747894, -1632648707, 2134862632, 1386497909, -1028097404, -1390684557, 2139709518, -1273156420, 1222056809, 539391017, 515802054, -2129230707, -1408995398, 632880332, 1772504308, -966063115, -1799725714, 21937287, 1477165581, 1253744553, 203783501, 1236677003, 689872, 1075533786, 1649769611, -97814566, -337441085, 675577244, 1367391544, 1379603351, 1049700765, 847335499, -14567500, -118886754, 1563060129, -1287483713, 1574055369, -1513139721, -1389614002, -1144038162, 775868583, -606258386, -1987052516, 1855178673, -2044004547, -1581253380, 1201608055, 85619372, -68842748, -1279064480, 2005250983, -307341145, 1996142013, 375123593, -271055130, -1781860008, 1096813866, 1849745898, 1007707851, -1605275342, -2140441286, 739923250, -704377305, -467115791, 1079222860, 242615640, -1837178453, 318613241, 347811431, -197558611, -2019686765, -980556544, 1553348267, 494206472, 1112036812, 1258750298, -842445917, 1544265955, -1912564262, -620488471, -889282158, 1299296056, 423665295, 1359890860, 1077172953, -73273843, -1659840926, 1392617912, -1081530607, 1303291967, 392392088, -2017022783, 1184793512, -1869570613, -955858860, 340061913, 618379975, 1011823494, -809881216, 1816787957, 1978588983, -1138006003, 2078237231, 1842692073, -620524373, -1715977758, -939991847, 1418466514, 1620817717, 1901794668, -1390883660, 1843164580, 1743133853, 578558002, -1932993837, -858994155, -1461717196, 1528030456, 1435696692, -648559285, -302632139, -1607714348, 223376167, 1711779466, 317524838, -1082127435, -1990228258, -668408596, 548540297, 1651542945, -1614026445, -1832238632, -1037581785, -1523665978, 600270447, -574372648, -763786315, 283393782, 1770243570, -734407698, -1703285931, -327559973, -1788065014, 960709480, -1814854069, -908948374, -436117987, 1682085334, -762279866, -183191368, 220080184, -57766241, -676428704, 1598532481, -1255434042, 1989286800, -1717498989, 1784442077, -1337246483, 1458785475, -1332638305, 145755964, -1074151148, 1287376035, 1362332800, 224035916, -23479538, -1409046242, -694125069, -566762324, -630866531, -347269928, 679566165, 276545043, 366390502, 288394184, -1914964681, -1286440751, -2020552257, 1678295557, -443199195, -1935636633, 2101386234, 818513443, -708582396, 1983248498, -1871954656, -161206170, -1859668546, -1151541471, 988479706, -1460631101, 971904816, -1519785494, -1915212800, -1888967964, -1802228876, -1296777115, 1201309406, -1531584106, 826582647, 118055960, -1132107069, -373631934, -1371339394, -1940516137, 1127749479, 1201351105, 68476456, -1744193508, -306861080, -980025384, -2072230927, -1736978617, 1572698384, 1177367976, -1156123924, 775840687, -1727327625, -38219474, -2063183380, -1110362267, 1684813422, -884896557, 1016574566, 803377337, 540645732, -1240017080, -1178332843, 2034593037, 1429295941, 1034344725, 1381736146, -62446596, -833249209, 1611256781, -1200401518, -518501295, 1572749265, -807863775, -746688917, 1656148124, -1201074141, 922162158, 302308805, 2079850451, 1040750617, 2011035759, 1436256879, 344405547, 1340950393, 1207010603, 1972919535, -2062377130, -975191328, -973132685, -1556578693, 931702417, -1990261158, 35115389, -1650124362, 500851691, -1315688156) 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\", \"activite\""} 
[2026-08-06 15:10:38] local.DEBUG: EmissionQueryBuilder {"context":"App\\Services\\Inventaire\\{closure}","mode":"agg","source_table":"observatoire.agg_epci","filter_level":"epci","display_level":null,"years":[2023,2024,2022,2021,2020,2019,2018,2017,2016,2015,2014,2012,2010,1990,2005],"sql":"select em.year_id, COALESCE(t.name, '(non rattaché)') AS territoire, COALESCE(a.name, '(non rattaché)') AS activite, ROUND((SUM(em.conso_ener_finale_clim_normal_gj)/3.6)::numeric, 2) AS conso_ener_finale_clim_normal_gj, ROUND(SUM(em.pm10_kg)::numeric, 4) AS pm10_kg, ROUND(SUM(em.pm2_5_kg)::numeric, 4) AS pm2_5_kg, ROUND(SUM(em.nox_kg)::numeric, 4) AS nox_kg, ROUND(SUM(em.prg_2021_teqco2_pcaet)::numeric, 4) AS prg_2021_teqco2_pcaet, ROUND((SUM(em.conso_ener_finale_clim_reel_gj)/3.6)::numeric, 2) AS conso_ener_finale_clim_reel_gj from \"observatoire\".\"agg_epci\" as \"em\" left join \"observatoire\".\"dim_territories\" as \"t\" on \"t\".\"id\" = \"em\".\"geo_id\" inner join \"observatoire\".\"dim_activity_memberships\" as \"dtm_a\" on \"dtm_a\".\"activity_id\" = \"em\".\"activity_id\" and \"dtm_a\".\"parent_id\" in (-622080275, 208862058, 74904297, 1926750763, 1705942411, -273970232, -1732845089, 14022040) inner join \"observatoire\".\"dim_activities\" as \"a\" on \"a\".\"id\" = \"dtm_a\".\"parent_id\" where \"em\".\"year_id\" in (2023, 2024, 2022, 2021, 2020, 2019, 2018, 2017, 2016, 2015, 2014, 2012, 2010, 1990, 2005) and \"em\".\"geo_id\" in (-2074645457) and \"em\".\"activity_id\" in (-2065015321, 1664202072, -1468143007, 1108698765, -697951920, 53616376, 911083398, -2129813176, -1918263047, -393206791, 562718587, 439277546, -858228785, 1839125859, 1824025864, 254468532, 1735525248, 240491429, 751538419, 1662919374, 1660135024, -2109039919, 97436677, -124660711, -1987478087, 722905366, -93516697, -818258464, -1982109166, 1409930224, -2034818798, 1822307428, -1758060949, 155019705, 1869212529, -609915394, 1481894613, 1395794963, 1695347196, 64335092, 921165895, -142018260, -482664252, 26668268, 942433737, 2101539831, -556896478, -289004236, 1180149453, -1100601087, 2113546912, -1166060768, -1270919973, 1741715211, -604604043, -1323823743, -65650287, -1771225083, 556015237, -497458774, 1890006254, -717879577, -475198975, 1306594475, 1087885866, -893165577, -1618922050, 409891242, -2075398489, 865842982, 1765509547, -1487210095, 76265396, 503239948, 1329377505, -2004721785, -1859723360, 1648387281, -731418973, -924061465, -519499276, -1689620327, 571578548, 1372013544, -2017652732, 506491597, 333711349, -1807500046, 680092381, 28083642, 879051533, -1167947622, 1900723648, -198132915, -567369811, 1273925006, 719954458, 1659802002, -1605866945, 1251539306, -1246034248, -2000350303, 122587945, 1855887801, 1307996793, -797747832, 1915345643, -719653191, -574407755, 747285232, 1757275487, 1312649538, 660808751, 1444864905, 82030098, 937605621, -1352377836, -407252425, 1763501654, -1405923019, 350725182, 1824837113, -1560607589, 682492730, 1303189715, 1734631443, 1243082219, 1140080948, -966852427, -632337157, 1663741761, -567757160, -1887790066, -837308181, -1623725498, -1436585389, -248116745, 2079193929, 1285586024, -1749430722, -717359299, -98448292, -853873446, -762838756, 1974523832, -1736763325, 859934642, 760580929, 1658855321, 138601578, 1153344103, 1280935296, -1951484904, 725270159, -1104146686, -225028528, -469721241, -1445420861, -2104684761, -1259394394, 1942080707, -913831972, 350561514, 1206983340, 1633334487, -1017289816, -843932025, -337017078, 454621909, 41079158, -1846591393, 804338617, 1352484195, 1426270099, -1732290900, 1353783048, -1078990055, -307626332, 2128833364, 1054770029, -740347188, -1430328674, 730376509, 504001257, -1859749546, -435776990, -2102767552, -933330074, 112476696, -446796902, -1546313589, 1663401832, 1104829866, -323474854, 906942419, -2009648112, -1608512036, 489987876, 301093584, 1663410790, -820564035, 1066750091, 2110173394, -2048915241, 859987309, 1134610842, -1219234331, 1099679168, 1855856603, -964500217, 21511964, 1388087176, 1967813158, -1063238036, -570672305, 2106414096, 1913359952, -2145734036, 342527500, 429059437, -295738415, -376271361, 827134186, 2047409618, 1519990054, -1487774563, 153764150, 1371033649, 776279000, 692870153, -1951358321, -889255393, 905336003, -1528757905, -1313144583, -189572407, 1219243506, -1959662381, -667330531, -1327037360, -388600018, -1768991392, 631501363, 1428443613, -794523335, -921669000, 50809254, -1151061648, -263558204, -1316167746, 254882134, -1432964826, 971161973, -869291431, -92274995, 2001828071, 717533312, -919698739, -115032065, -1710809284, 1440646841, 438839785, 1838130794, -1438657658, -2100037337, -1645230407, -35163706, -244693147, 747547873, -178006637, -316787613, -1609021450, 425592013, 1142721112, 1125960239, 342687363, -715496447, -466654990, -22267807, 2004972987, 373557710, -538767368, -583628804, 1231105243, -148499659, -1978708979, 1035684050, 595015853, 1713779118, 530155604, 1319740754, -1878882180, -578878727, 46178169, 1173150921, 707403387, 595454509, 2093595260, -178885722, 1933574569, 1689971204, 2099170107, -23642967, -893109849, -394754806, -1052690536, 373550100, -1337323363, 1447225472, 1276215965, 33249239, 730336352, -639410621, 932667705, -1839258623, 1911698987, -37699356, -982013561, -1459018491, -883327242, 1252179801, -450105656, -799071091, -1118403434, -432827018, -2125877781, -1464392700, -1334310062, 1371610371, -1652853783, 2106513667, -1320908412, -1981687934, 1764341119, -457559919, -1414713643, -394200259, -1573937312, -1087220802, 1173327443, 1942963054, -1193483522, 575519546, 1411111401, -50696485, -390568655, -1496086086, -273047452, 1578846294, -1189987097, -366685926, -390542442, 310956635, 494216435, -1591836854, -1958561345, 2001630306, -1144004711, 942233085, -1824930634, -35558533, -1345162752, 1713162907, -600367835, -1294709678, -356747582, -761498023, -1171478393, -487172781, -1805861555, 1024219564, 579293477, 1140113838, -1419278172, 2024238092, -182420025, -1904591798, 2117082238, 1974281097, -1743267982, -919487101, -770400240, -1939219148, 1687214361, -543242059, 1687613177, 692025924, 1949554747, -1071587566, 216692383, -1231239857, -301100043, 1184608045, 1570062812, 1744165561, -2024511393, -2117292693, -183910117, -1210454800, 933754793, 1924478818, 1584015331, -1929400904, -1865280307, 589008399, -125964541, 1640238785, -1829002824, 1898736760, 2108532170, 1044726750, 1923261691, 1227983953, -1363934197, 384410393, -2044885611, 919914692, 736532642, -1239747894, -1632648707, 2134862632, 1386497909, -1028097404, -1390684557, 2139709518, -1273156420, 1222056809, 539391017, 515802054, -2129230707, -1408995398, 632880332, 1772504308, -966063115, -1799725714, 21937287, 1477165581, 1253744553, 203783501, 1236677003, 689872, 1075533786, 1649769611, -97814566, -337441085, 675577244, 1367391544, 1379603351, 1049700765, 847335499, -14567500, -118886754, 1563060129, -1287483713, 1574055369, -1513139721, -1389614002, -1144038162, 775868583, -606258386, -1987052516, 1855178673, -2044004547, -1581253380, 1201608055, 85619372, -68842748, -1279064480, 2005250983, -307341145, 1996142013, 375123593, -271055130, -1781860008, 1096813866, 1849745898, 1007707851, -1605275342, -2140441286, 739923250, -704377305, -467115791, 1079222860, 242615640, -1837178453, 318613241, 347811431, -197558611, -2019686765, -980556544, 1553348267, 494206472, 1112036812, 1258750298, -842445917, 1544265955, -1912564262, -620488471, -889282158, 1299296056, 423665295, 1359890860, 1077172953, -73273843, -1659840926, 1392617912, -1081530607, 1303291967, 392392088, -2017022783, 1184793512, -1869570613, -955858860, 340061913, 618379975, 1011823494, -809881216, 1816787957, 1978588983, -1138006003, 2078237231, 1842692073, -620524373, -1715977758, -939991847, 1418466514, 1620817717, 1901794668, -1390883660, 1843164580, 1743133853, 578558002, -1932993837, -858994155, -1461717196, 1528030456, 1435696692, -648559285, -302632139, -1607714348, 223376167, 1711779466, 317524838, -1082127435, -1990228258, -668408596, 548540297, 1651542945, -1614026445, -1832238632, -1037581785, -1523665978, 600270447, -574372648, -763786315, 283393782, 1770243570, -734407698, -1703285931, -327559973, -1788065014, 960709480, -1814854069, -908948374, -436117987, 1682085334, -762279866, -183191368, 220080184, -57766241, -676428704, 1598532481, -1255434042, 1989286800, -1717498989, 1784442077, -1337246483, 1458785475, -1332638305, 145755964, -1074151148, 1287376035, 1362332800, 224035916, -23479538, -1409046242, -694125069, -566762324, -630866531, -347269928, 679566165, 276545043, 366390502, 288394184, -1914964681, -1286440751, -2020552257, 1678295557, -443199195, -1935636633, 2101386234, 818513443, -708582396, 1983248498, -1871954656, -161206170, -1859668546, -1151541471, 988479706, -1460631101, 971904816, -1519785494, -1915212800, -1888967964, -1802228876, -1296777115, 1201309406, -1531584106, 826582647, 118055960, -1132107069, -373631934, -1371339394, -1940516137, 1127749479, 1201351105, 68476456, -1744193508, -306861080, -980025384, -2072230927, -1736978617, 1572698384, 1177367976, -1156123924, 775840687, -1727327625, -38219474, -2063183380, -1110362267, 1684813422, -884896557, 1016574566, 803377337, 540645732, -1240017080, -1178332843, 2034593037, 1429295941, 1034344725, 1381736146, -62446596, -833249209, 1611256781, -1200401518, -518501295, 1572749265, -807863775, -746688917, 1656148124, -1201074141, 922162158, 302308805, 2079850451, 1040750617, 2011035759, 1436256879, 344405547, 1340950393, 1207010603, 1972919535, -2062377130, -975191328, -973132685, -1556578693, 931702417, -1990261158, 35115389, -1650124362, 500851691, -1315688156) 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\", \"activite\""} 
[2026-08-06 15:20:43] local.DEBUG: EmissionQueryBuilder {"context":"App\\Services\\Inventaire\\{closure}","mode":"agg","source_table":"observatoire.agg_epci","filter_level":"epci","display_level":null,"years":[2023,2024,2022,2021,2020,2019,2018,2017,2016,2015,2014,2012,2010,1990,2005],"sql":"select em.year_id, COALESCE(t.name, '(non rattaché)') AS territoire, COALESCE(a.name, '(non rattaché)') AS activite, COALESCE(f.name, '(non rattaché)') AS combustible, ROUND((SUM(em.conso_ener_finale_clim_normal_gj)/3.6)::numeric, 2) AS conso_ener_finale_clim_normal_gj, ROUND(SUM(em.pm10_kg)::numeric, 4) AS pm10_kg, ROUND(SUM(em.pm2_5_kg)::numeric, 4) AS pm2_5_kg, ROUND(SUM(em.nox_kg)::numeric, 4) AS nox_kg, ROUND(SUM(em.prg_2021_teqco2_pcaet)::numeric, 4) AS prg_2021_teqco2_pcaet, ROUND((SUM(em.conso_ener_finale_clim_reel_gj)/3.6)::numeric, 2) AS conso_ener_finale_clim_reel_gj from \"observatoire\".\"agg_epci\" as \"em\" left join \"observatoire\".\"dim_territories\" as \"t\" on \"t\".\"id\" = \"em\".\"geo_id\" inner join \"observatoire\".\"dim_activity_memberships\" as \"dtm_a\" on \"dtm_a\".\"activity_id\" = \"em\".\"activity_id\" and \"dtm_a\".\"parent_id\" in (-622080275, 208862058, 74904297, 1926750763, 1705942411, -273970232, -1732845089, 14022040) inner join \"observatoire\".\"dim_activities\" as \"a\" on \"a\".\"id\" = \"dtm_a\".\"parent_id\" inner join \"observatoire\".\"dim_fuel_memberships\" as \"dtm_f\" on \"dtm_f\".\"fuel_id\" = \"em\".\"fuel_id\" and \"dtm_f\".\"parent_id\" in (2053746054, 588797234, 1806425435) inner join \"observatoire\".\"dim_fuels\" as \"f\" on \"f\".\"id\" = \"dtm_f\".\"parent_id\" where \"em\".\"year_id\" in (2023, 2024, 2022, 2021, 2020, 2019, 2018, 2017, 2016, 2015, 2014, 2012, 2010, 1990, 2005) and \"em\".\"geo_id\" in (-2074645457) and \"em\".\"activity_id\" in (-2065015321, 1664202072, -1468143007, 1108698765, -697951920, 53616376, 911083398, -2129813176, -1918263047, -393206791, 562718587, 439277546, -858228785, 1839125859, 1824025864, 254468532, 1735525248, 240491429, 751538419, 1662919374, 1660135024, -2109039919, 97436677, -124660711, -1987478087, 722905366, -93516697, -818258464, -1982109166, 1409930224, -2034818798, 1822307428, -1758060949, 155019705, 1869212529, -609915394, 1481894613, 1395794963, 1695347196, 64335092, 921165895, -142018260, -482664252, 26668268, 942433737, 2101539831, -556896478, -289004236, 1180149453, -1100601087, 2113546912, -1166060768, -1270919973, 1741715211, -604604043, -1323823743, -65650287, -1771225083, 556015237, -497458774, 1890006254, -717879577, -475198975, 1306594475, 1087885866, -893165577, -1618922050, 409891242, -2075398489, 865842982, 1765509547, -1487210095, 76265396, 503239948, 1329377505, -2004721785, -1859723360, 1648387281, -731418973, -924061465, -519499276, -1689620327, 571578548, 1372013544, -2017652732, 506491597, 333711349, -1807500046, 680092381, 28083642, 879051533, -1167947622, 1900723648, -198132915, -567369811, 1273925006, 719954458, 1659802002, -1605866945, 1251539306, -1246034248, -2000350303, 122587945, 1855887801, 1307996793, -797747832, 1915345643, -719653191, -574407755, 747285232, 1757275487, 1312649538, 660808751, 1444864905, 82030098, 937605621, -1352377836, -407252425, 1763501654, -1405923019, 350725182, 1824837113, -1560607589, 682492730, 1303189715, 1734631443, 1243082219, 1140080948, -966852427, -632337157, 1663741761, -567757160, -1887790066, -837308181, -1623725498, -1436585389, -248116745, 2079193929, 1285586024, -1749430722, -717359299, -98448292, -853873446, -762838756, 1974523832, -1736763325, 859934642, 760580929, 1658855321, 138601578, 1153344103, 1280935296, -1951484904, 725270159, -1104146686, -225028528, -469721241, -1445420861, -2104684761, -1259394394, 1942080707, -913831972, 350561514, 1206983340, 1633334487, -1017289816, -843932025, -337017078, 454621909, 41079158, -1846591393, 804338617, 1352484195, 1426270099, -1732290900, 1353783048, -1078990055, -307626332, 2128833364, 1054770029, -740347188, -1430328674, 730376509, 504001257, -1859749546, -435776990, -2102767552, -933330074, 112476696, -446796902, -1546313589, 1663401832, 1104829866, -323474854, 906942419, -2009648112, -1608512036, 489987876, 301093584, 1663410790, -820564035, 1066750091, 2110173394, -2048915241, 859987309, 1134610842, -1219234331, 1099679168, 1855856603, -964500217, 21511964, 1388087176, 1967813158, -1063238036, -570672305, 2106414096, 1913359952, -2145734036, 342527500, 429059437, -295738415, -376271361, 827134186, 2047409618, 1519990054, -1487774563, 153764150, 1371033649, 776279000, 692870153, -1951358321, -889255393, 905336003, -1528757905, -1313144583, -189572407, 1219243506, -1959662381, -667330531, -1327037360, -388600018, -1768991392, 631501363, 1428443613, -794523335, -921669000, 50809254, -1151061648, -263558204, -1316167746, 254882134, -1432964826, 971161973, -869291431, -92274995, 2001828071, 717533312, -919698739, -115032065, -1710809284, 1440646841, 438839785, 1838130794, -1438657658, -2100037337, -1645230407, -35163706, -244693147, 747547873, -178006637, -316787613, -1609021450, 425592013, 1142721112, 1125960239, 342687363, -715496447, -466654990, -22267807, 2004972987, 373557710, -538767368, -583628804, 1231105243, -148499659, -1978708979, 1035684050, 595015853, 1713779118, 530155604, 1319740754, -1878882180, -578878727, 46178169, 1173150921, 707403387, 595454509, 2093595260, -178885722, 1933574569, 1689971204, 2099170107, -23642967, -893109849, -394754806, -1052690536, 373550100, -1337323363, 1447225472, 1276215965, 33249239, 730336352, -639410621, 932667705, -1839258623, 1911698987, -37699356, -982013561, -1459018491, -883327242, 1252179801, -450105656, -799071091, -1118403434, -432827018, -2125877781, -1464392700, -1334310062, 1371610371, -1652853783, 2106513667, -1320908412, -1981687934, 1764341119, -457559919, -1414713643, -394200259, -1573937312, -1087220802, 1173327443, 1942963054, -1193483522, 575519546, 1411111401, -50696485, -390568655, -1496086086, -273047452, 1578846294, -1189987097, -366685926, -390542442, 310956635, 494216435, -1591836854, -1958561345, 2001630306, -1144004711, 942233085, -1824930634, -35558533, -1345162752, 1713162907, -600367835, -1294709678, -356747582, -761498023, -1171478393, -487172781, -1805861555, 1024219564, 579293477, 1140113838, -1419278172, 2024238092, -182420025, -1904591798, 2117082238, 1974281097, -1743267982, -919487101, -770400240, -1939219148, 1687214361, -543242059, 1687613177, 692025924, 1949554747, -1071587566, 216692383, -1231239857, -301100043, 1184608045, 1570062812, 1744165561, -2024511393, -2117292693, -183910117, -1210454800, 933754793, 1924478818, 1584015331, -1929400904, -1865280307, 589008399, -125964541, 1640238785, -1829002824, 1898736760, 2108532170, 1044726750, 1923261691, 1227983953, -1363934197, 384410393, -2044885611, 919914692, 736532642, -1239747894, -1632648707, 2134862632, 1386497909, -1028097404, -1390684557, 2139709518, -1273156420, 1222056809, 539391017, 515802054, -2129230707, -1408995398, 632880332, 1772504308, -966063115, -1799725714, 21937287, 1477165581, 1253744553, 203783501, 1236677003, 689872, 1075533786, 1649769611, -97814566, -337441085, 675577244, 1367391544, 1379603351, 1049700765, 847335499, -14567500, -118886754, 1563060129, -1287483713, 1574055369, -1513139721, -1389614002, -1144038162, 775868583, -606258386, -1987052516, 1855178673, -2044004547, -1581253380, 1201608055, 85619372, -68842748, -1279064480, 2005250983, -307341145, 1996142013, 375123593, -271055130, -1781860008, 1096813866, 1849745898, 1007707851, -1605275342, -2140441286, 739923250, -704377305, -467115791, 1079222860, 242615640, -1837178453, 318613241, 347811431, -197558611, -2019686765, -980556544, 1553348267, 494206472, 1112036812, 1258750298, -842445917, 1544265955, -1912564262, -620488471, -889282158, 1299296056, 423665295, 1359890860, 1077172953, -73273843, -1659840926, 1392617912, -1081530607, 1303291967, 392392088, -2017022783, 1184793512, -1869570613, -955858860, 340061913, 618379975, 1011823494, -809881216, 1816787957, 1978588983, -1138006003, 2078237231, 1842692073, -620524373, -1715977758, -939991847, 1418466514, 1620817717, 1901794668, -1390883660, 1843164580, 1743133853, 578558002, -1932993837, -858994155, -1461717196, 1528030456, 1435696692, -648559285, -302632139, -1607714348, 223376167, 1711779466, 317524838, -1082127435, -1990228258, -668408596, 548540297, 1651542945, -1614026445, -1832238632, -1037581785, -1523665978, 600270447, -574372648, -763786315, 283393782, 1770243570, -734407698, -1703285931, -327559973, -1788065014, 960709480, -1814854069, -908948374, -436117987, 1682085334, -762279866, -183191368, 220080184, -57766241, -676428704, 1598532481, -1255434042, 1989286800, -1717498989, 1784442077, -1337246483, 1458785475, -1332638305, 145755964, -1074151148, 1287376035, 1362332800, 224035916, -23479538, -1409046242, -694125069, -566762324, -630866531, -347269928, 679566165, 276545043, 366390502, 288394184, -1914964681, -1286440751, -2020552257, 1678295557, -443199195, -1935636633, 2101386234, 818513443, -708582396, 1983248498, -1871954656, -161206170, -1859668546, -1151541471, 988479706, -1460631101, 971904816, -1519785494, -1915212800, -1888967964, -1802228876, -1296777115, 1201309406, -1531584106, 826582647, 118055960, -1132107069, -373631934, -1371339394, -1940516137, 1127749479, 1201351105, 68476456, -1744193508, -306861080, -980025384, -2072230927, -1736978617, 1572698384, 1177367976, -1156123924, 775840687, -1727327625, -38219474, -2063183380, -1110362267, 1684813422, -884896557, 1016574566, 803377337, 540645732, -1240017080, -1178332843, 2034593037, 1429295941, 1034344725, 1381736146, -62446596, -833249209, 1611256781, -1200401518, -518501295, 1572749265, -807863775, -746688917, 1656148124, -1201074141, 922162158, 302308805, 2079850451, 1040750617, 2011035759, 1436256879, 344405547, 1340950393, 1207010603, 1972919535, -2062377130, -975191328, -973132685, -1556578693, 931702417, -1990261158, 35115389, -1650124362, 500851691, -1315688156) and \"em\".\"activity_id\" not in (-1961301967, 1409433884, -480772070, 253605083, -1464052776, -290906344, -1845071579, 1744461479, -1645028903, -990500766, 454426900, 1145100677, -1320427570, 1885478838, 1588799712, 1741583917) and \"em\".\"fuel_id\" in (1344636899, -1909685346, 1625866553, -830241899, 13585771, 618715071, -1163760912, -59538796, 915693911, -1660819109, 1898049943, -52796417, -507988172, 767873144, 1484267897, 556720288, -825344667, -1358379524, 1084264565, -248609480, 208303479, 1385935766, -1906149501, -1994671959, 1587660764, -784501144, -1272684724, 521156911, 580937015, 1992193200, -1454921658, 1506772054, 78930848, -83169964, -664757232, -704599906, 1611197846, 1330229813, -874737624, -1809684072, 1801451108, -683447095, -791711088, -601886031) group by \"em\".\"year_id\", \"territoire\", \"activite\", \"combustible\""} 
[2026-08-06 15:20:43] local.DEBUG: EmissionQueryBuilder {"context":"App\\Services\\Inventaire\\{closure}","mode":"agg","source_table":"observatoire.agg_epci","filter_level":"epci","display_level":null,"years":[2023,2024,2022,2021,2020,2019,2018,2017,2016,2015,2014,2012,2010,1990,2005],"sql":"select em.year_id, COALESCE(t.name, '(non rattaché)') AS territoire, COALESCE(a.name, '(non rattaché)') AS activite, COALESCE(f.name, '(non rattaché)') AS combustible, ROUND((SUM(em.conso_ener_finale_clim_normal_gj)/3.6)::numeric, 2) AS conso_ener_finale_clim_normal_gj, ROUND(SUM(em.pm10_kg)::numeric, 4) AS pm10_kg, ROUND(SUM(em.pm2_5_kg)::numeric, 4) AS pm2_5_kg, ROUND(SUM(em.nox_kg)::numeric, 4) AS nox_kg, ROUND(SUM(em.prg_2021_teqco2_pcaet)::numeric, 4) AS prg_2021_teqco2_pcaet, ROUND((SUM(em.conso_ener_finale_clim_reel_gj)/3.6)::numeric, 2) AS conso_ener_finale_clim_reel_gj from \"observatoire\".\"agg_epci\" as \"em\" left join \"observatoire\".\"dim_territories\" as \"t\" on \"t\".\"id\" = \"em\".\"geo_id\" inner join \"observatoire\".\"dim_activity_memberships\" as \"dtm_a\" on \"dtm_a\".\"activity_id\" = \"em\".\"activity_id\" and \"dtm_a\".\"parent_id\" in (-622080275, 208862058, 74904297, 1926750763, 1705942411, -273970232, -1732845089, 14022040) inner join \"observatoire\".\"dim_activities\" as \"a\" on \"a\".\"id\" = \"dtm_a\".\"parent_id\" inner join \"observatoire\".\"dim_fuel_memberships\" as \"dtm_f\" on \"dtm_f\".\"fuel_id\" = \"em\".\"fuel_id\" and \"dtm_f\".\"parent_id\" in (2053746054, 588797234, 1806425435) inner join \"observatoire\".\"dim_fuels\" as \"f\" on \"f\".\"id\" = \"dtm_f\".\"parent_id\" where \"em\".\"year_id\" in (2023, 2024, 2022, 2021, 2020, 2019, 2018, 2017, 2016, 2015, 2014, 2012, 2010, 1990, 2005) and \"em\".\"geo_id\" in (-2074645457) and \"em\".\"activity_id\" in (-2065015321, 1664202072, -1468143007, 1108698765, -697951920, 53616376, 911083398, -2129813176, -1918263047, -393206791, 562718587, 439277546, -858228785, 1839125859, 1824025864, 254468532, 1735525248, 240491429, 751538419, 1662919374, 1660135024, -2109039919, 97436677, -124660711, -1987478087, 722905366, -93516697, -818258464, -1982109166, 1409930224, -2034818798, 1822307428, -1758060949, 155019705, 1869212529, -609915394, 1481894613, 1395794963, 1695347196, 64335092, 921165895, -142018260, -482664252, 26668268, 942433737, 2101539831, -556896478, -289004236, 1180149453, -1100601087, 2113546912, -1166060768, -1270919973, 1741715211, -604604043, -1323823743, -65650287, -1771225083, 556015237, -497458774, 1890006254, -717879577, -475198975, 1306594475, 1087885866, -893165577, -1618922050, 409891242, -2075398489, 865842982, 1765509547, -1487210095, 76265396, 503239948, 1329377505, -2004721785, -1859723360, 1648387281, -731418973, -924061465, -519499276, -1689620327, 571578548, 1372013544, -2017652732, 506491597, 333711349, -1807500046, 680092381, 28083642, 879051533, -1167947622, 1900723648, -198132915, -567369811, 1273925006, 719954458, 1659802002, -1605866945, 1251539306, -1246034248, -2000350303, 122587945, 1855887801, 1307996793, -797747832, 1915345643, -719653191, -574407755, 747285232, 1757275487, 1312649538, 660808751, 1444864905, 82030098, 937605621, -1352377836, -407252425, 1763501654, -1405923019, 350725182, 1824837113, -1560607589, 682492730, 1303189715, 1734631443, 1243082219, 1140080948, -966852427, -632337157, 1663741761, -567757160, -1887790066, -837308181, -1623725498, -1436585389, -248116745, 2079193929, 1285586024, -1749430722, -717359299, -98448292, -853873446, -762838756, 1974523832, -1736763325, 859934642, 760580929, 1658855321, 138601578, 1153344103, 1280935296, -1951484904, 725270159, -1104146686, -225028528, -469721241, -1445420861, -2104684761, -1259394394, 1942080707, -913831972, 350561514, 1206983340, 1633334487, -1017289816, -843932025, -337017078, 454621909, 41079158, -1846591393, 804338617, 1352484195, 1426270099, -1732290900, 1353783048, -1078990055, -307626332, 2128833364, 1054770029, -740347188, -1430328674, 730376509, 504001257, -1859749546, -435776990, -2102767552, -933330074, 112476696, -446796902, -1546313589, 1663401832, 1104829866, -323474854, 906942419, -2009648112, -1608512036, 489987876, 301093584, 1663410790, -820564035, 1066750091, 2110173394, -2048915241, 859987309, 1134610842, -1219234331, 1099679168, 1855856603, -964500217, 21511964, 1388087176, 1967813158, -1063238036, -570672305, 2106414096, 1913359952, -2145734036, 342527500, 429059437, -295738415, -376271361, 827134186, 2047409618, 1519990054, -1487774563, 153764150, 1371033649, 776279000, 692870153, -1951358321, -889255393, 905336003, -1528757905, -1313144583, -189572407, 1219243506, -1959662381, -667330531, -1327037360, -388600018, -1768991392, 631501363, 1428443613, -794523335, -921669000, 50809254, -1151061648, -263558204, -1316167746, 254882134, -1432964826, 971161973, -869291431, -92274995, 2001828071, 717533312, -919698739, -115032065, -1710809284, 1440646841, 438839785, 1838130794, -1438657658, -2100037337, -1645230407, -35163706, -244693147, 747547873, -178006637, -316787613, -1609021450, 425592013, 1142721112, 1125960239, 342687363, -715496447, -466654990, -22267807, 2004972987, 373557710, -538767368, -583628804, 1231105243, -148499659, -1978708979, 1035684050, 595015853, 1713779118, 530155604, 1319740754, -1878882180, -578878727, 46178169, 1173150921, 707403387, 595454509, 2093595260, -178885722, 1933574569, 1689971204, 2099170107, -23642967, -893109849, -394754806, -1052690536, 373550100, -1337323363, 1447225472, 1276215965, 33249239, 730336352, -639410621, 932667705, -1839258623, 1911698987, -37699356, -982013561, -1459018491, -883327242, 1252179801, -450105656, -799071091, -1118403434, -432827018, -2125877781, -1464392700, -1334310062, 1371610371, -1652853783, 2106513667, -1320908412, -1981687934, 1764341119, -457559919, -1414713643, -394200259, -1573937312, -1087220802, 1173327443, 1942963054, -1193483522, 575519546, 1411111401, -50696485, -390568655, -1496086086, -273047452, 1578846294, -1189987097, -366685926, -390542442, 310956635, 494216435, -1591836854, -1958561345, 2001630306, -1144004711, 942233085, -1824930634, -35558533, -1345162752, 1713162907, -600367835, -1294709678, -356747582, -761498023, -1171478393, -487172781, -1805861555, 1024219564, 579293477, 1140113838, -1419278172, 2024238092, -182420025, -1904591798, 2117082238, 1974281097, -1743267982, -919487101, -770400240, -1939219148, 1687214361, -543242059, 1687613177, 692025924, 1949554747, -1071587566, 216692383, -1231239857, -301100043, 1184608045, 1570062812, 1744165561, -2024511393, -2117292693, -183910117, -1210454800, 933754793, 1924478818, 1584015331, -1929400904, -1865280307, 589008399, -125964541, 1640238785, -1829002824, 1898736760, 2108532170, 1044726750, 1923261691, 1227983953, -1363934197, 384410393, -2044885611, 919914692, 736532642, -1239747894, -1632648707, 2134862632, 1386497909, -1028097404, -1390684557, 2139709518, -1273156420, 1222056809, 539391017, 515802054, -2129230707, -1408995398, 632880332, 1772504308, -966063115, -1799725714, 21937287, 1477165581, 1253744553, 203783501, 1236677003, 689872, 1075533786, 1649769611, -97814566, -337441085, 675577244, 1367391544, 1379603351, 1049700765, 847335499, -14567500, -118886754, 1563060129, -1287483713, 1574055369, -1513139721, -1389614002, -1144038162, 775868583, -606258386, -1987052516, 1855178673, -2044004547, -1581253380, 1201608055, 85619372, -68842748, -1279064480, 2005250983, -307341145, 1996142013, 375123593, -271055130, -1781860008, 1096813866, 1849745898, 1007707851, -1605275342, -2140441286, 739923250, -704377305, -467115791, 1079222860, 242615640, -1837178453, 318613241, 347811431, -197558611, -2019686765, -980556544, 1553348267, 494206472, 1112036812, 1258750298, -842445917, 1544265955, -1912564262, -620488471, -889282158, 1299296056, 423665295, 1359890860, 1077172953, -73273843, -1659840926, 1392617912, -1081530607, 1303291967, 392392088, -2017022783, 1184793512, -1869570613, -955858860, 340061913, 618379975, 1011823494, -809881216, 1816787957, 1978588983, -1138006003, 2078237231, 1842692073, -620524373, -1715977758, -939991847, 1418466514, 1620817717, 1901794668, -1390883660, 1843164580, 1743133853, 578558002, -1932993837, -858994155, -1461717196, 1528030456, 1435696692, -648559285, -302632139, -1607714348, 223376167, 1711779466, 317524838, -1082127435, -1990228258, -668408596, 548540297, 1651542945, -1614026445, -1832238632, -1037581785, -1523665978, 600270447, -574372648, -763786315, 283393782, 1770243570, -734407698, -1703285931, -327559973, -1788065014, 960709480, -1814854069, -908948374, -436117987, 1682085334, -762279866, -183191368, 220080184, -57766241, -676428704, 1598532481, -1255434042, 1989286800, -1717498989, 1784442077, -1337246483, 1458785475, -1332638305, 145755964, -1074151148, 1287376035, 1362332800, 224035916, -23479538, -1409046242, -694125069, -566762324, -630866531, -347269928, 679566165, 276545043, 366390502, 288394184, -1914964681, -1286440751, -2020552257, 1678295557, -443199195, -1935636633, 2101386234, 818513443, -708582396, 1983248498, -1871954656, -161206170, -1859668546, -1151541471, 988479706, -1460631101, 971904816, -1519785494, -1915212800, -1888967964, -1802228876, -1296777115, 1201309406, -1531584106, 826582647, 118055960, -1132107069, -373631934, -1371339394, -1940516137, 1127749479, 1201351105, 68476456, -1744193508, -306861080, -980025384, -2072230927, -1736978617, 1572698384, 1177367976, -1156123924, 775840687, -1727327625, -38219474, -2063183380, -1110362267, 1684813422, -884896557, 1016574566, 803377337, 540645732, -1240017080, -1178332843, 2034593037, 1429295941, 1034344725, 1381736146, -62446596, -833249209, 1611256781, -1200401518, -518501295, 1572749265, -807863775, -746688917, 1656148124, -1201074141, 922162158, 302308805, 2079850451, 1040750617, 2011035759, 1436256879, 344405547, 1340950393, 1207010603, 1972919535, -2062377130, -975191328, -973132685, -1556578693, 931702417, -1990261158, 35115389, -1650124362, 500851691, -1315688156) and \"em\".\"activity_id\" not in (-1961301967, 1409433884, -480772070, 253605083, -1464052776, -290906344, -1845071579, 1744461479, -1645028903, -990500766, 454426900, 1145100677, -1320427570, 1885478838, 1588799712, 1741583917) and \"em\".\"fuel_id\" in (1344636899, -1909685346, 1625866553, -830241899, 13585771, 618715071, -1163760912, -59538796, 915693911, -1660819109, 1898049943, -52796417, -507988172, 767873144, 1484267897, 556720288, -825344667, -1358379524, 1084264565, -248609480, 208303479, 1385935766, -1906149501, -1994671959, 1587660764, -784501144, -1272684724, 521156911, 580937015, 1992193200, -1454921658, 1506772054, 78930848, -83169964, -664757232, -704599906, 1611197846, 1330229813, -874737624, -1809684072, 1801451108, -683447095, -791711088, -601886031) group by \"em\".\"year_id\", \"territoire\", \"activite\", \"combustible\""} 
[2026-08-06 15:21:30] local.DEBUG: ProductionQueryBuilder {"context":"App\\Services\\Inventaire\\{closure}","mode":"fact","source_table":"observatoire.fact_production","filter_level":"epci","display_level":null,"years":[2023,2024,2022,2021,2020,2019,2018,2017,2016,2015,2014,2012,2010,1990,2005],"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 (2023, 2024, 2022, 2021, 2020, 2019, 2018, 2017, 2016, 2015, 2014, 2012, 2010, 1990, 2005) 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 (315631697) inner join \"observatoire\".\"dim_filieres\" as \"fi\" on \"fi\".\"id\" = \"dtm_fi\".\"parent_id\" where \"fp\".\"filiere_id\" in (-1960216134, -1165502792, 774281089, 1506126584, -929314708, 1723321957, 1340024063, -996979377, 1764268061, 1498175839, -1312393098, 1453260670, -498981429, 1852304876, 1371856852, -318804108, -1844241335, 1961061561, 1963506075, -1773246028, -1993658124, 1489167039, -992312423, -1982952820, 1200710728, 874142471, 753002958) 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-08-06 15:21:30] local.DEBUG: ProductionQueryBuilder {"context":"App\\Services\\Inventaire\\{closure}","mode":"fact","source_table":"observatoire.fact_production","filter_level":"epci","display_level":null,"years":[2023,2024,2022,2021,2020,2019,2018,2017,2016,2015,2014,2012,2010,1990,2005],"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 (2023, 2024, 2022, 2021, 2020, 2019, 2018, 2017, 2016, 2015, 2014, 2012, 2010, 1990, 2005) 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 (315631697) inner join \"observatoire\".\"dim_filieres\" as \"fi\" on \"fi\".\"id\" = \"dtm_fi\".\"parent_id\" where \"fp\".\"filiere_id\" in (-1960216134, -1165502792, 774281089, 1506126584, -929314708, 1723321957, 1340024063, -996979377, 1764268061, 1498175839, -1312393098, 1453260670, -498981429, 1852304876, 1371856852, -318804108, -1844241335, 1961061561, 1963506075, -1773246028, -1993658124, 1489167039, -992312423, -1982952820, 1200710728, 874142471, 753002958) 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-08-06 15:21:41] local.DEBUG: ProductionQueryBuilder {"context":"App\\Services\\Inventaire\\{closure}","mode":"fact","source_table":"observatoire.fact_production","filter_level":"epci","display_level":null,"years":[2023,2024,2022,2021,2020,2019,2018,2017,2016,2015,2014,2012,2010,1990,2005],"sql":"select fp.year_id, COALESCE(t.name, '(non rattaché)') AS territoire, COALESCE(fi.name, '(non rattaché)') AS filiere_parent, COALESCE(fi_display.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 (2023, 2024, 2022, 2021, 2020, 2019, 2018, 2017, 2016, 2015, 2014, 2012, 2010, 1990, 2005) 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 (315631697) inner join \"observatoire\".\"dim_filieres\" as \"fi\" on \"fi\".\"id\" = \"dtm_fi\".\"parent_id\" inner join \"observatoire\".\"dim_filiere_memberships\" as \"dtm_fi_display\" on \"dtm_fi_display\".\"filiere_id\" = \"fp\".\"filiere_id\" inner join \"observatoire\".\"dim_filieres\" as \"fi_display\" on \"fi_display\".\"id\" = \"dtm_fi_display\".\"parent_id\" and \"fi_display\".\"type_id\" = 'filiere_detail_externe' where \"fp\".\"filiere_id\" in (-1960216134, -1165502792, 774281089, 1506126584, -929314708, 1723321957, 1340024063, -996979377, 1764268061, 1498175839, -1312393098, 1453260670, -498981429, 1852304876, 1371856852, -318804108, -1844241335, 1961061561, 1963506075, -1773246028, -1993658124, 1489167039, -992312423, -1982952820, 1200710728, 874142471, 753002958) 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_parent\", \"filiere\""} 
[2026-08-06 15:21:41] local.DEBUG: ProductionQueryBuilder {"context":"App\\Services\\Inventaire\\{closure}","mode":"fact","source_table":"observatoire.fact_production","filter_level":"epci","display_level":null,"years":[2023,2024,2022,2021,2020,2019,2018,2017,2016,2015,2014,2012,2010,1990,2005],"sql":"select fp.year_id, COALESCE(t.name, '(non rattaché)') AS territoire, COALESCE(fi.name, '(non rattaché)') AS filiere_parent, COALESCE(fi_display.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 (2023, 2024, 2022, 2021, 2020, 2019, 2018, 2017, 2016, 2015, 2014, 2012, 2010, 1990, 2005) 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 (315631697) inner join \"observatoire\".\"dim_filieres\" as \"fi\" on \"fi\".\"id\" = \"dtm_fi\".\"parent_id\" inner join \"observatoire\".\"dim_filiere_memberships\" as \"dtm_fi_display\" on \"dtm_fi_display\".\"filiere_id\" = \"fp\".\"filiere_id\" inner join \"observatoire\".\"dim_filieres\" as \"fi_display\" on \"fi_display\".\"id\" = \"dtm_fi_display\".\"parent_id\" and \"fi_display\".\"type_id\" = 'filiere_detail_externe' where \"fp\".\"filiere_id\" in (-1960216134, -1165502792, 774281089, 1506126584, -929314708, 1723321957, 1340024063, -996979377, 1764268061, 1498175839, -1312393098, 1453260670, -498981429, 1852304876, 1371856852, -318804108, -1844241335, 1961061561, 1963506075, -1773246028, -1993658124, 1489167039, -992312423, -1982952820, 1200710728, 874142471, 753002958) 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_parent\", \"filiere\""} 
[2026-08-06 15:21:49] local.DEBUG: ProductionQueryBuilder {"context":"App\\Services\\Inventaire\\{closure}","mode":"fact","source_table":"observatoire.fact_production","filter_level":"epci","display_level":null,"years":[2023,2024,2022,2021,2020,2019,2018,2017,2016,2015,2014,2012,2010,1990,2005],"sql":"select fp.year_id, COALESCE(t.name, '(non rattaché)') AS territoire, COALESCE(fi.name, '(non rattaché)') AS filiere_parent, COALESCE(fi_display.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 (2023, 2024, 2022, 2021, 2020, 2019, 2018, 2017, 2016, 2015, 2014, 2012, 2010, 1990, 2005) 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 (315631697) inner join \"observatoire\".\"dim_filieres\" as \"fi\" on \"fi\".\"id\" = \"dtm_fi\".\"parent_id\" inner join \"observatoire\".\"dim_filiere_memberships\" as \"dtm_fi_display\" on \"dtm_fi_display\".\"filiere_id\" = \"fp\".\"filiere_id\" inner join \"observatoire\".\"dim_filieres\" as \"fi_display\" on \"fi_display\".\"id\" = \"dtm_fi_display\".\"parent_id\" and \"fi_display\".\"type_id\" = 'filiere_detail_externe' where \"fp\".\"filiere_id\" in (-1960216134, -1165502792, 774281089, 1506126584, -929314708, 1723321957, 1340024063, -996979377, 1764268061, 1498175839, -1312393098, 1453260670, -498981429, 1852304876, 1371856852, -318804108, -1844241335, 1961061561, 1963506075, -1773246028, -1993658124, 1489167039, -992312423, -1982952820, 1200710728, 874142471, 753002958) 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_parent\", \"filiere\""} 
[2026-08-06 15:26:30] 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, COALESCE(f.name, '(non rattaché)') AS combustible, ROUND((SUM(conso_ener_finale_clim_reel_gj_n1)/3.6)::numeric, 2) AS conso_ener_finale_clim_reel_gj_n1, ROUND(SUM(fe1.co2_bio_kg_n1)::numeric, 4) AS co2_bio_kg_n1, ROUND(SUM(fe1.co2_ind_kg_n1)::numeric, 4) AS co2_ind_kg_n1, ROUND(SUM(fe1.co2_kg_pcaet_n1)::numeric, 4) AS co2_kg_pcaet_n1, ROUND(SUM(fe1.ch4_kg_pcaet_n1)::numeric, 4) AS ch4_kg_pcaet_n1, ROUND(SUM(fe1.n2o_kg_pcaet_n1)::numeric, 4) AS n2o_kg_pcaet_n1, ROUND(SUM(fe1.prg_2013_teqco2_pcaet_n1)::numeric, 4) AS prg_2013_teqco2_pcaet_n1, ROUND(SUM(fe1.prg_2021_teqco2_pcaet_n1)::numeric, 4) AS prg_2021_teqco2_pcaet_n1, ROUND(SUM(fe1.prg_fluores_2013_teqco2_pcaet_n1)::numeric, 4) AS prg_fluores_2013_teqco2_pcaet_n1, ROUND(SUM(fe1.prg_fluores_2021_teqco2_pcaet_n1)::numeric, 4) AS prg_fluores_2021_teqco2_pcaet_n1, 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\" inner join \"observatoire\".\"dim_fuels\" as \"f\" on \"f\".\"id\" = \"fe1\".\"fuel_cat_id\" where \"fe1\".\"year_id\" in (2025) and \"fe1\".\"geo_id\" in (-1290362788) and \"fe1\".\"activity_pcaet_id\" in (-622080275, 208862058, 74904297, 1926750763, 1705942411, -273970232, -1732845089, 14022040) and \"fe1\".\"activity_secten_id\" not in (633536125, 1705364151) and \"fe1\".\"fuel_cat_id\" in (-920315543, 588797234, -1751782324, 2053746054, 1806425435, 324701552, 1761117992, 1747110739, -1099704847) group by \"fe1\".\"year_id\", \"territoire\", \"activite\", \"combustible\""} 
[2026-08-06 15:26:30] 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, COALESCE(f.name, '(non rattaché)') AS combustible, ROUND((SUM(conso_ener_finale_clim_reel_gj_n1)/3.6)::numeric, 2) AS conso_ener_finale_clim_reel_gj_n1, ROUND(SUM(fe1.co2_bio_kg_n1)::numeric, 4) AS co2_bio_kg_n1, ROUND(SUM(fe1.co2_ind_kg_n1)::numeric, 4) AS co2_ind_kg_n1, ROUND(SUM(fe1.co2_kg_pcaet_n1)::numeric, 4) AS co2_kg_pcaet_n1, ROUND(SUM(fe1.ch4_kg_pcaet_n1)::numeric, 4) AS ch4_kg_pcaet_n1, ROUND(SUM(fe1.n2o_kg_pcaet_n1)::numeric, 4) AS n2o_kg_pcaet_n1, ROUND(SUM(fe1.prg_2013_teqco2_pcaet_n1)::numeric, 4) AS prg_2013_teqco2_pcaet_n1, ROUND(SUM(fe1.prg_2021_teqco2_pcaet_n1)::numeric, 4) AS prg_2021_teqco2_pcaet_n1, ROUND(SUM(fe1.prg_fluores_2013_teqco2_pcaet_n1)::numeric, 4) AS prg_fluores_2013_teqco2_pcaet_n1, ROUND(SUM(fe1.prg_fluores_2021_teqco2_pcaet_n1)::numeric, 4) AS prg_fluores_2021_teqco2_pcaet_n1, 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\" inner join \"observatoire\".\"dim_fuels\" as \"f\" on \"f\".\"id\" = \"fe1\".\"fuel_cat_id\" where \"fe1\".\"year_id\" in (2025) and \"fe1\".\"geo_id\" in (-1290362788) and \"fe1\".\"activity_pcaet_id\" in (-622080275, 208862058, 74904297, 1926750763, 1705942411, -273970232, -1732845089, 14022040) and \"fe1\".\"activity_secten_id\" not in (633536125, 1705364151) and \"fe1\".\"fuel_cat_id\" in (-920315543, 588797234, -1751782324, 2053746054, 1806425435, 324701552, 1761117992, 1747110739, -1099704847) group by \"fe1\".\"year_id\", \"territoire\", \"activite\", \"combustible\""} 
[2026-08-06 15:26:40] 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, COALESCE(f.name, '(non rattaché)') AS combustible, ROUND((SUM(conso_ener_finale_clim_reel_gj_n1)/3.6)::numeric, 2) AS conso_ener_finale_clim_reel_gj_n1, ROUND(SUM(fe1.co2_bio_kg_n1)::numeric, 4) AS co2_bio_kg_n1, ROUND(SUM(fe1.co2_ind_kg_n1)::numeric, 4) AS co2_ind_kg_n1, ROUND(SUM(fe1.co2_kg_pcaet_n1)::numeric, 4) AS co2_kg_pcaet_n1, ROUND(SUM(fe1.ch4_kg_pcaet_n1)::numeric, 4) AS ch4_kg_pcaet_n1, ROUND(SUM(fe1.n2o_kg_pcaet_n1)::numeric, 4) AS n2o_kg_pcaet_n1, ROUND(SUM(fe1.prg_2013_teqco2_pcaet_n1)::numeric, 4) AS prg_2013_teqco2_pcaet_n1, ROUND(SUM(fe1.prg_2021_teqco2_pcaet_n1)::numeric, 4) AS prg_2021_teqco2_pcaet_n1, ROUND(SUM(fe1.prg_fluores_2013_teqco2_pcaet_n1)::numeric, 4) AS prg_fluores_2013_teqco2_pcaet_n1, ROUND(SUM(fe1.prg_fluores_2021_teqco2_pcaet_n1)::numeric, 4) AS prg_fluores_2021_teqco2_pcaet_n1, 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\" inner join \"observatoire\".\"dim_fuels\" as \"f\" on \"f\".\"id\" = \"fe1\".\"fuel_cat_id\" where \"fe1\".\"year_id\" in (2025) and \"fe1\".\"geo_id\" in (-1290362788) and \"fe1\".\"activity_pcaet_id\" in (-622080275, 208862058, 74904297, 1926750763, 1705942411, -273970232, -1732845089, 14022040) and \"fe1\".\"activity_secten_id\" not in (633536125, 1705364151) and \"fe1\".\"fuel_cat_id\" in (-920315543, 588797234, -1751782324, 2053746054, 1806425435, 324701552, 1761117992, 1747110739, -1099704847) group by \"fe1\".\"year_id\", \"territoire\", \"activite\", \"combustible\""} 
[2026-08-06 16:02:21] local.DEBUG: EmissionQueryBuilder {"context":"App\\Services\\Inventaire\\{closure}","mode":"agg","source_table":"observatoire.agg_reg","filter_level":"reg","display_level":null,"years":[2024,2023,2022,2021,2020,2019,2018,2017,2016,2015,2014,2012,2010,2005,1990],"sql":"select em.year_id, COALESCE(t.name, '(non rattaché)') AS territoire, COALESCE(a.name, '(non rattaché)') AS activite, ROUND(SUM(em.prg_2013_teqco2_pcaet)::numeric, 4) AS prg_2013_teqco2_pcaet, ROUND(SUM(em.prg_2021_teqco2_pcaet)::numeric, 4) AS prg_2021_teqco2_pcaet from \"observatoire\".\"agg_reg\" as \"em\" left join \"observatoire\".\"dim_territories\" as \"t\" on \"t\".\"id\" = \"em\".\"geo_id\" inner join \"observatoire\".\"dim_activity_memberships\" as \"dtm_a\" on \"dtm_a\".\"activity_id\" = \"em\".\"activity_id\" and \"dtm_a\".\"parent_id\" in (-622080275, 208862058, 74904297, 1926750763, 1705942411, -273970232, -1732845089, 14022040) inner join \"observatoire\".\"dim_activities\" as \"a\" on \"a\".\"id\" = \"dtm_a\".\"parent_id\" where \"em\".\"year_id\" in (2024, 2023, 2022, 2021, 2020, 2019, 2018, 2017, 2016, 2015, 2014, 2012, 2010, 2005, 1990) and \"em\".\"geo_id\" in (936037254) and \"em\".\"activity_id\" in (-2065015321, 1664202072, -1468143007, 1108698765, -697951920, 53616376, 911083398, -2129813176, -1918263047, -393206791, 562718587, 439277546, -858228785, 1839125859, 1824025864, 254468532, 1735525248, 240491429, 751538419, 1662919374, 1660135024, -2109039919, 97436677, -124660711, -1987478087, 722905366, -93516697, -818258464, -1982109166, 1409930224, -2034818798, 1822307428, -1758060949, 155019705, 1869212529, -609915394, 1481894613, 1395794963, 1695347196, 64335092, 921165895, -142018260, -482664252, 26668268, 942433737, 2101539831, -556896478, -289004236, 1180149453, -1100601087, 2113546912, -1166060768, -1270919973, 1741715211, -604604043, -1323823743, -65650287, -1771225083, 556015237, -497458774, 1890006254, -717879577, -475198975, 1306594475, 1087885866, -893165577, -1618922050, 409891242, -2075398489, 865842982, 1765509547, -1487210095, 76265396, 503239948, 1329377505, -2004721785, -1859723360, 1648387281, -731418973, -924061465, -519499276, -1689620327, 571578548, 1372013544, -2017652732, 506491597, 333711349, -1807500046, 680092381, 28083642, 879051533, -1167947622, 1900723648, -198132915, -567369811, 1273925006, 719954458, 1659802002, -1605866945, 1251539306, -1246034248, -2000350303, 122587945, 1855887801, 1307996793, -797747832, 1915345643, -719653191, -574407755, 747285232, 1757275487, 1312649538, 660808751, 1444864905, 82030098, 937605621, -1352377836, -407252425, 1763501654, -1405923019, 350725182, 1824837113, -1560607589, 682492730, 1303189715, 1734631443, 1243082219, 1140080948, -966852427, -632337157, 1663741761, -567757160, -1887790066, -837308181, -1623725498, -1436585389, -248116745, 2079193929, 1285586024, -1749430722, -717359299, -98448292, -853873446, -762838756, 1974523832, -1736763325, 859934642, 760580929, 1658855321, 138601578, 1153344103, 1280935296, -1951484904, 725270159, -1104146686, -225028528, -469721241, -1445420861, -2104684761, -1259394394, 1942080707, -913831972, 350561514, 1206983340, 1633334487, -1017289816, -843932025, -337017078, 454621909, 41079158, -1846591393, 804338617, 1352484195, 1426270099, -1732290900, 1353783048, -1078990055, -307626332, 2128833364, 1054770029, -740347188, -1430328674, 730376509, 504001257, -1859749546, -435776990, -2102767552, -933330074, 112476696, -446796902, -1546313589, 1663401832, 1104829866, -323474854, 906942419, -2009648112, -1608512036, 489987876, 301093584, 1663410790, -820564035, 1066750091, 2110173394, -2048915241, 859987309, 1134610842, -1219234331, 1099679168, 1855856603, -964500217, 21511964, 1388087176, 1967813158, -1063238036, -570672305, 2106414096, 1913359952, -2145734036, 342527500, 429059437, -295738415, -376271361, 827134186, 2047409618, 1519990054, -1487774563, 153764150, 1371033649, 776279000, 692870153, -1951358321, -889255393, 905336003, -1528757905, -1313144583, -189572407, 1219243506, -1959662381, -667330531, -1327037360, -388600018, -1768991392, 631501363, 1428443613, -794523335, -921669000, 50809254, -1151061648, -263558204, -1316167746, 254882134, -1432964826, 971161973, -869291431, -92274995, 2001828071, 717533312, -919698739, -115032065, -1710809284, 1440646841, 438839785, 1838130794, -1438657658, -2100037337, -1645230407, -35163706, -244693147, 747547873, -178006637, -316787613, -1609021450, 425592013, 1142721112, 1125960239, 342687363, -715496447, -466654990, -22267807, 2004972987, 373557710, -538767368, -583628804, 1231105243, -148499659, -1978708979, 1035684050, 595015853, 1713779118, 530155604, 1319740754, -1878882180, -578878727, 46178169, 1173150921, 707403387, 595454509, 2093595260, -178885722, 1933574569, 1689971204, 2099170107, -23642967, -893109849, -394754806, -1052690536, 373550100, -1337323363, 1447225472, 1276215965, 33249239, 730336352, -639410621, 932667705, -1839258623, 1911698987, -37699356, -982013561, -1459018491, -883327242, 1252179801, -450105656, -799071091, -1118403434, -432827018, -2125877781, -1464392700, -1334310062, 1371610371, -1652853783, 2106513667, -1320908412, -1981687934, 1764341119, -457559919, -1414713643, -394200259, -1573937312, -1087220802, 1173327443, 1942963054, -1193483522, 575519546, 1411111401, -50696485, -390568655, -1496086086, -273047452, 1578846294, -1189987097, -366685926, -390542442, 310956635, 494216435, -1591836854, -1958561345, 2001630306, -1144004711, 942233085, -1824930634, -35558533, -1345162752, 1713162907, -600367835, -1294709678, -356747582, -761498023, -1171478393, -487172781, -1805861555, 1024219564, 579293477, 1140113838, -1419278172, 2024238092, -182420025, -1904591798, 2117082238, 1974281097, -1743267982, -919487101, -770400240, -1939219148, 1687214361, -543242059, 1687613177, 692025924, 1949554747, -1071587566, 216692383, -1231239857, -301100043, 1184608045, 1570062812, 1744165561, -2024511393, -2117292693, -183910117, -1210454800, 933754793, 1924478818, 1584015331, -1929400904, -1865280307, 589008399, -125964541, 1640238785, -1829002824, 1898736760, 2108532170, 1044726750, 1923261691, 1227983953, -1363934197, 384410393, -2044885611, 919914692, 736532642, -1239747894, -1632648707, 2134862632, 1386497909, -1028097404, -1390684557, 2139709518, -1273156420, 1222056809, 539391017, 515802054, -2129230707, -1408995398, 632880332, 1772504308, -966063115, -1799725714, 21937287, 1477165581, 1253744553, 203783501, 1236677003, 689872, 1075533786, 1649769611, -97814566, -337441085, 675577244, 1367391544, 1379603351, 1049700765, 847335499, -14567500, -118886754, 1563060129, -1287483713, 1574055369, -1513139721, -1389614002, -1144038162, 775868583, -606258386, -1987052516, 1855178673, -2044004547, -1581253380, 1201608055, 85619372, -68842748, -1279064480, 2005250983, -307341145, 1996142013, 375123593, -271055130, -1781860008, 1096813866, 1849745898, 1007707851, -1605275342, -2140441286, 739923250, -704377305, -467115791, 1079222860, 242615640, -1837178453, 318613241, 347811431, -197558611, -2019686765, -980556544, 1553348267, 494206472, 1112036812, 1258750298, -842445917, 1544265955, -1912564262, -620488471, -889282158, 1299296056, 423665295, 1359890860, 1077172953, -73273843, -1659840926, 1392617912, -1081530607, 1303291967, 392392088, -2017022783, 1184793512, -1869570613, -955858860, 340061913, 618379975, 1011823494, -809881216, 1816787957, 1978588983, -1138006003, 2078237231, 1842692073, -620524373, -1715977758, -939991847, 1418466514, 1620817717, 1901794668, -1390883660, 1843164580, 1743133853, 578558002, -1932993837, -858994155, -1461717196, 1528030456, 1435696692, -648559285, -302632139, -1607714348, 223376167, 1711779466, 317524838, -1082127435, -1990228258, -668408596, 548540297, 1651542945, -1614026445, -1832238632, -1037581785, -1523665978, 600270447, -574372648, -763786315, 283393782, 1770243570, -734407698, -1703285931, -327559973, -1788065014, 960709480, -1814854069, -908948374, -436117987, 1682085334, -762279866, -183191368, 220080184, -57766241, -676428704, 1598532481, -1255434042, 1989286800, -1717498989, 1784442077, -1337246483, 1458785475, -1332638305, 145755964, -1074151148, 1287376035, 1362332800, 224035916, -23479538, -1409046242, -694125069, -566762324, -630866531, -347269928, 679566165, 276545043, 366390502, 288394184, -1914964681, -1286440751, -2020552257, 1678295557, -443199195, -1935636633, 2101386234, 818513443, -708582396, 1983248498, -1871954656, -161206170, -1859668546, -1151541471, 988479706, -1460631101, 971904816, -1519785494, -1915212800, -1888967964, -1802228876, -1296777115, 1201309406, -1531584106, 826582647, 118055960, -1132107069, -373631934, -1371339394, -1940516137, 1127749479, 1201351105, 68476456, -1744193508, -306861080, -980025384, -2072230927, -1736978617, 1572698384, 1177367976, -1156123924, 775840687, -1727327625, -38219474, -2063183380, -1110362267, 1684813422, -884896557, 1016574566, 803377337, 540645732, -1240017080, -1178332843, 2034593037, 1429295941, 1034344725, 1381736146, -62446596, -833249209, 1611256781, -1200401518, -518501295, 1572749265, -807863775, -746688917, 1656148124, -1201074141, 922162158, 302308805, 2079850451, 1040750617, 2011035759, 1436256879, 344405547, 1340950393, 1207010603, 1972919535, -2062377130, -975191328, -973132685, -1556578693, 931702417, -1990261158, 35115389, -1650124362, 500851691, -1315688156) 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\", \"activite\""} 
[2026-08-06 16:02:21] local.DEBUG: EmissionQueryBuilder {"context":"App\\Services\\Inventaire\\{closure}","mode":"agg","source_table":"observatoire.agg_reg","filter_level":"reg","display_level":null,"years":[2024,2023,2022,2021,2020,2019,2018,2017,2016,2015,2014,2012,2010,2005,1990],"sql":"select em.year_id, COALESCE(t.name, '(non rattaché)') AS territoire, COALESCE(a.name, '(non rattaché)') AS activite, ROUND(SUM(em.prg_2013_teqco2_pcaet)::numeric, 4) AS prg_2013_teqco2_pcaet, ROUND(SUM(em.prg_2021_teqco2_pcaet)::numeric, 4) AS prg_2021_teqco2_pcaet from \"observatoire\".\"agg_reg\" as \"em\" left join \"observatoire\".\"dim_territories\" as \"t\" on \"t\".\"id\" = \"em\".\"geo_id\" inner join \"observatoire\".\"dim_activity_memberships\" as \"dtm_a\" on \"dtm_a\".\"activity_id\" = \"em\".\"activity_id\" and \"dtm_a\".\"parent_id\" in (-622080275, 208862058, 74904297, 1926750763, 1705942411, -273970232, -1732845089, 14022040) inner join \"observatoire\".\"dim_activities\" as \"a\" on \"a\".\"id\" = \"dtm_a\".\"parent_id\" where \"em\".\"year_id\" in (2024, 2023, 2022, 2021, 2020, 2019, 2018, 2017, 2016, 2015, 2014, 2012, 2010, 2005, 1990) and \"em\".\"geo_id\" in (936037254) and \"em\".\"activity_id\" in (-2065015321, 1664202072, -1468143007, 1108698765, -697951920, 53616376, 911083398, -2129813176, -1918263047, -393206791, 562718587, 439277546, -858228785, 1839125859, 1824025864, 254468532, 1735525248, 240491429, 751538419, 1662919374, 1660135024, -2109039919, 97436677, -124660711, -1987478087, 722905366, -93516697, -818258464, -1982109166, 1409930224, -2034818798, 1822307428, -1758060949, 155019705, 1869212529, -609915394, 1481894613, 1395794963, 1695347196, 64335092, 921165895, -142018260, -482664252, 26668268, 942433737, 2101539831, -556896478, -289004236, 1180149453, -1100601087, 2113546912, -1166060768, -1270919973, 1741715211, -604604043, -1323823743, -65650287, -1771225083, 556015237, -497458774, 1890006254, -717879577, -475198975, 1306594475, 1087885866, -893165577, -1618922050, 409891242, -2075398489, 865842982, 1765509547, -1487210095, 76265396, 503239948, 1329377505, -2004721785, -1859723360, 1648387281, -731418973, -924061465, -519499276, -1689620327, 571578548, 1372013544, -2017652732, 506491597, 333711349, -1807500046, 680092381, 28083642, 879051533, -1167947622, 1900723648, -198132915, -567369811, 1273925006, 719954458, 1659802002, -1605866945, 1251539306, -1246034248, -2000350303, 122587945, 1855887801, 1307996793, -797747832, 1915345643, -719653191, -574407755, 747285232, 1757275487, 1312649538, 660808751, 1444864905, 82030098, 937605621, -1352377836, -407252425, 1763501654, -1405923019, 350725182, 1824837113, -1560607589, 682492730, 1303189715, 1734631443, 1243082219, 1140080948, -966852427, -632337157, 1663741761, -567757160, -1887790066, -837308181, -1623725498, -1436585389, -248116745, 2079193929, 1285586024, -1749430722, -717359299, -98448292, -853873446, -762838756, 1974523832, -1736763325, 859934642, 760580929, 1658855321, 138601578, 1153344103, 1280935296, -1951484904, 725270159, -1104146686, -225028528, -469721241, -1445420861, -2104684761, -1259394394, 1942080707, -913831972, 350561514, 1206983340, 1633334487, -1017289816, -843932025, -337017078, 454621909, 41079158, -1846591393, 804338617, 1352484195, 1426270099, -1732290900, 1353783048, -1078990055, -307626332, 2128833364, 1054770029, -740347188, -1430328674, 730376509, 504001257, -1859749546, -435776990, -2102767552, -933330074, 112476696, -446796902, -1546313589, 1663401832, 1104829866, -323474854, 906942419, -2009648112, -1608512036, 489987876, 301093584, 1663410790, -820564035, 1066750091, 2110173394, -2048915241, 859987309, 1134610842, -1219234331, 1099679168, 1855856603, -964500217, 21511964, 1388087176, 1967813158, -1063238036, -570672305, 2106414096, 1913359952, -2145734036, 342527500, 429059437, -295738415, -376271361, 827134186, 2047409618, 1519990054, -1487774563, 153764150, 1371033649, 776279000, 692870153, -1951358321, -889255393, 905336003, -1528757905, -1313144583, -189572407, 1219243506, -1959662381, -667330531, -1327037360, -388600018, -1768991392, 631501363, 1428443613, -794523335, -921669000, 50809254, -1151061648, -263558204, -1316167746, 254882134, -1432964826, 971161973, -869291431, -92274995, 2001828071, 717533312, -919698739, -115032065, -1710809284, 1440646841, 438839785, 1838130794, -1438657658, -2100037337, -1645230407, -35163706, -244693147, 747547873, -178006637, -316787613, -1609021450, 425592013, 1142721112, 1125960239, 342687363, -715496447, -466654990, -22267807, 2004972987, 373557710, -538767368, -583628804, 1231105243, -148499659, -1978708979, 1035684050, 595015853, 1713779118, 530155604, 1319740754, -1878882180, -578878727, 46178169, 1173150921, 707403387, 595454509, 2093595260, -178885722, 1933574569, 1689971204, 2099170107, -23642967, -893109849, -394754806, -1052690536, 373550100, -1337323363, 1447225472, 1276215965, 33249239, 730336352, -639410621, 932667705, -1839258623, 1911698987, -37699356, -982013561, -1459018491, -883327242, 1252179801, -450105656, -799071091, -1118403434, -432827018, -2125877781, -1464392700, -1334310062, 1371610371, -1652853783, 2106513667, -1320908412, -1981687934, 1764341119, -457559919, -1414713643, -394200259, -1573937312, -1087220802, 1173327443, 1942963054, -1193483522, 575519546, 1411111401, -50696485, -390568655, -1496086086, -273047452, 1578846294, -1189987097, -366685926, -390542442, 310956635, 494216435, -1591836854, -1958561345, 2001630306, -1144004711, 942233085, -1824930634, -35558533, -1345162752, 1713162907, -600367835, -1294709678, -356747582, -761498023, -1171478393, -487172781, -1805861555, 1024219564, 579293477, 1140113838, -1419278172, 2024238092, -182420025, -1904591798, 2117082238, 1974281097, -1743267982, -919487101, -770400240, -1939219148, 1687214361, -543242059, 1687613177, 692025924, 1949554747, -1071587566, 216692383, -1231239857, -301100043, 1184608045, 1570062812, 1744165561, -2024511393, -2117292693, -183910117, -1210454800, 933754793, 1924478818, 1584015331, -1929400904, -1865280307, 589008399, -125964541, 1640238785, -1829002824, 1898736760, 2108532170, 1044726750, 1923261691, 1227983953, -1363934197, 384410393, -2044885611, 919914692, 736532642, -1239747894, -1632648707, 2134862632, 1386497909, -1028097404, -1390684557, 2139709518, -1273156420, 1222056809, 539391017, 515802054, -2129230707, -1408995398, 632880332, 1772504308, -966063115, -1799725714, 21937287, 1477165581, 1253744553, 203783501, 1236677003, 689872, 1075533786, 1649769611, -97814566, -337441085, 675577244, 1367391544, 1379603351, 1049700765, 847335499, -14567500, -118886754, 1563060129, -1287483713, 1574055369, -1513139721, -1389614002, -1144038162, 775868583, -606258386, -1987052516, 1855178673, -2044004547, -1581253380, 1201608055, 85619372, -68842748, -1279064480, 2005250983, -307341145, 1996142013, 375123593, -271055130, -1781860008, 1096813866, 1849745898, 1007707851, -1605275342, -2140441286, 739923250, -704377305, -467115791, 1079222860, 242615640, -1837178453, 318613241, 347811431, -197558611, -2019686765, -980556544, 1553348267, 494206472, 1112036812, 1258750298, -842445917, 1544265955, -1912564262, -620488471, -889282158, 1299296056, 423665295, 1359890860, 1077172953, -73273843, -1659840926, 1392617912, -1081530607, 1303291967, 392392088, -2017022783, 1184793512, -1869570613, -955858860, 340061913, 618379975, 1011823494, -809881216, 1816787957, 1978588983, -1138006003, 2078237231, 1842692073, -620524373, -1715977758, -939991847, 1418466514, 1620817717, 1901794668, -1390883660, 1843164580, 1743133853, 578558002, -1932993837, -858994155, -1461717196, 1528030456, 1435696692, -648559285, -302632139, -1607714348, 223376167, 1711779466, 317524838, -1082127435, -1990228258, -668408596, 548540297, 1651542945, -1614026445, -1832238632, -1037581785, -1523665978, 600270447, -574372648, -763786315, 283393782, 1770243570, -734407698, -1703285931, -327559973, -1788065014, 960709480, -1814854069, -908948374, -436117987, 1682085334, -762279866, -183191368, 220080184, -57766241, -676428704, 1598532481, -1255434042, 1989286800, -1717498989, 1784442077, -1337246483, 1458785475, -1332638305, 145755964, -1074151148, 1287376035, 1362332800, 224035916, -23479538, -1409046242, -694125069, -566762324, -630866531, -347269928, 679566165, 276545043, 366390502, 288394184, -1914964681, -1286440751, -2020552257, 1678295557, -443199195, -1935636633, 2101386234, 818513443, -708582396, 1983248498, -1871954656, -161206170, -1859668546, -1151541471, 988479706, -1460631101, 971904816, -1519785494, -1915212800, -1888967964, -1802228876, -1296777115, 1201309406, -1531584106, 826582647, 118055960, -1132107069, -373631934, -1371339394, -1940516137, 1127749479, 1201351105, 68476456, -1744193508, -306861080, -980025384, -2072230927, -1736978617, 1572698384, 1177367976, -1156123924, 775840687, -1727327625, -38219474, -2063183380, -1110362267, 1684813422, -884896557, 1016574566, 803377337, 540645732, -1240017080, -1178332843, 2034593037, 1429295941, 1034344725, 1381736146, -62446596, -833249209, 1611256781, -1200401518, -518501295, 1572749265, -807863775, -746688917, 1656148124, -1201074141, 922162158, 302308805, 2079850451, 1040750617, 2011035759, 1436256879, 344405547, 1340950393, 1207010603, 1972919535, -2062377130, -975191328, -973132685, -1556578693, 931702417, -1990261158, 35115389, -1650124362, 500851691, -1315688156) 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\", \"activite\""} 
[2026-08-06 16:02:23] local.DEBUG: EmissionQueryBuilder {"context":"App\\Services\\Inventaire\\{closure}","mode":"agg","source_table":"observatoire.agg_reg","filter_level":"reg","display_level":null,"years":[2024,2023,2022,2021,2020,2019,2018,2017,2016,2015,2014,2012,2010,2005,1990],"sql":"select em.year_id, COALESCE(t.name, '(non rattaché)') AS territoire, COALESCE(a.name, '(non rattaché)') AS activite, ROUND(SUM(em.prg_2013_teqco2_pcaet)::numeric, 4) AS prg_2013_teqco2_pcaet, ROUND(SUM(em.prg_2021_teqco2_pcaet)::numeric, 4) AS prg_2021_teqco2_pcaet from \"observatoire\".\"agg_reg\" as \"em\" left join \"observatoire\".\"dim_territories\" as \"t\" on \"t\".\"id\" = \"em\".\"geo_id\" inner join \"observatoire\".\"dim_activity_memberships\" as \"dtm_a\" on \"dtm_a\".\"activity_id\" = \"em\".\"activity_id\" and \"dtm_a\".\"parent_id\" in (-622080275, 208862058, 74904297, 1926750763, 1705942411, -273970232, -1732845089, 14022040) inner join \"observatoire\".\"dim_activities\" as \"a\" on \"a\".\"id\" = \"dtm_a\".\"parent_id\" where \"em\".\"year_id\" in (2024, 2023, 2022, 2021, 2020, 2019, 2018, 2017, 2016, 2015, 2014, 2012, 2010, 2005, 1990) and \"em\".\"geo_id\" in (936037254) and \"em\".\"activity_id\" in (-2065015321, 1664202072, -1468143007, 1108698765, -697951920, 53616376, 911083398, -2129813176, -1918263047, -393206791, 562718587, 439277546, -858228785, 1839125859, 1824025864, 254468532, 1735525248, 240491429, 751538419, 1662919374, 1660135024, -2109039919, 97436677, -124660711, -1987478087, 722905366, -93516697, -818258464, -1982109166, 1409930224, -2034818798, 1822307428, -1758060949, 155019705, 1869212529, -609915394, 1481894613, 1395794963, 1695347196, 64335092, 921165895, -142018260, -482664252, 26668268, 942433737, 2101539831, -556896478, -289004236, 1180149453, -1100601087, 2113546912, -1166060768, -1270919973, 1741715211, -604604043, -1323823743, -65650287, -1771225083, 556015237, -497458774, 1890006254, -717879577, -475198975, 1306594475, 1087885866, -893165577, -1618922050, 409891242, -2075398489, 865842982, 1765509547, -1487210095, 76265396, 503239948, 1329377505, -2004721785, -1859723360, 1648387281, -731418973, -924061465, -519499276, -1689620327, 571578548, 1372013544, -2017652732, 506491597, 333711349, -1807500046, 680092381, 28083642, 879051533, -1167947622, 1900723648, -198132915, -567369811, 1273925006, 719954458, 1659802002, -1605866945, 1251539306, -1246034248, -2000350303, 122587945, 1855887801, 1307996793, -797747832, 1915345643, -719653191, -574407755, 747285232, 1757275487, 1312649538, 660808751, 1444864905, 82030098, 937605621, -1352377836, -407252425, 1763501654, -1405923019, 350725182, 1824837113, -1560607589, 682492730, 1303189715, 1734631443, 1243082219, 1140080948, -966852427, -632337157, 1663741761, -567757160, -1887790066, -837308181, -1623725498, -1436585389, -248116745, 2079193929, 1285586024, -1749430722, -717359299, -98448292, -853873446, -762838756, 1974523832, -1736763325, 859934642, 760580929, 1658855321, 138601578, 1153344103, 1280935296, -1951484904, 725270159, -1104146686, -225028528, -469721241, -1445420861, -2104684761, -1259394394, 1942080707, -913831972, 350561514, 1206983340, 1633334487, -1017289816, -843932025, -337017078, 454621909, 41079158, -1846591393, 804338617, 1352484195, 1426270099, -1732290900, 1353783048, -1078990055, -307626332, 2128833364, 1054770029, -740347188, -1430328674, 730376509, 504001257, -1859749546, -435776990, -2102767552, -933330074, 112476696, -446796902, -1546313589, 1663401832, 1104829866, -323474854, 906942419, -2009648112, -1608512036, 489987876, 301093584, 1663410790, -820564035, 1066750091, 2110173394, -2048915241, 859987309, 1134610842, -1219234331, 1099679168, 1855856603, -964500217, 21511964, 1388087176, 1967813158, -1063238036, -570672305, 2106414096, 1913359952, -2145734036, 342527500, 429059437, -295738415, -376271361, 827134186, 2047409618, 1519990054, -1487774563, 153764150, 1371033649, 776279000, 692870153, -1951358321, -889255393, 905336003, -1528757905, -1313144583, -189572407, 1219243506, -1959662381, -667330531, -1327037360, -388600018, -1768991392, 631501363, 1428443613, -794523335, -921669000, 50809254, -1151061648, -263558204, -1316167746, 254882134, -1432964826, 971161973, -869291431, -92274995, 2001828071, 717533312, -919698739, -115032065, -1710809284, 1440646841, 438839785, 1838130794, -1438657658, -2100037337, -1645230407, -35163706, -244693147, 747547873, -178006637, -316787613, -1609021450, 425592013, 1142721112, 1125960239, 342687363, -715496447, -466654990, -22267807, 2004972987, 373557710, -538767368, -583628804, 1231105243, -148499659, -1978708979, 1035684050, 595015853, 1713779118, 530155604, 1319740754, -1878882180, -578878727, 46178169, 1173150921, 707403387, 595454509, 2093595260, -178885722, 1933574569, 1689971204, 2099170107, -23642967, -893109849, -394754806, -1052690536, 373550100, -1337323363, 1447225472, 1276215965, 33249239, 730336352, -639410621, 932667705, -1839258623, 1911698987, -37699356, -982013561, -1459018491, -883327242, 1252179801, -450105656, -799071091, -1118403434, -432827018, -2125877781, -1464392700, -1334310062, 1371610371, -1652853783, 2106513667, -1320908412, -1981687934, 1764341119, -457559919, -1414713643, -394200259, -1573937312, -1087220802, 1173327443, 1942963054, -1193483522, 575519546, 1411111401, -50696485, -390568655, -1496086086, -273047452, 1578846294, -1189987097, -366685926, -390542442, 310956635, 494216435, -1591836854, -1958561345, 2001630306, -1144004711, 942233085, -1824930634, -35558533, -1345162752, 1713162907, -600367835, -1294709678, -356747582, -761498023, -1171478393, -487172781, -1805861555, 1024219564, 579293477, 1140113838, -1419278172, 2024238092, -182420025, -1904591798, 2117082238, 1974281097, -1743267982, -919487101, -770400240, -1939219148, 1687214361, -543242059, 1687613177, 692025924, 1949554747, -1071587566, 216692383, -1231239857, -301100043, 1184608045, 1570062812, 1744165561, -2024511393, -2117292693, -183910117, -1210454800, 933754793, 1924478818, 1584015331, -1929400904, -1865280307, 589008399, -125964541, 1640238785, -1829002824, 1898736760, 2108532170, 1044726750, 1923261691, 1227983953, -1363934197, 384410393, -2044885611, 919914692, 736532642, -1239747894, -1632648707, 2134862632, 1386497909, -1028097404, -1390684557, 2139709518, -1273156420, 1222056809, 539391017, 515802054, -2129230707, -1408995398, 632880332, 1772504308, -966063115, -1799725714, 21937287, 1477165581, 1253744553, 203783501, 1236677003, 689872, 1075533786, 1649769611, -97814566, -337441085, 675577244, 1367391544, 1379603351, 1049700765, 847335499, -14567500, -118886754, 1563060129, -1287483713, 1574055369, -1513139721, -1389614002, -1144038162, 775868583, -606258386, -1987052516, 1855178673, -2044004547, -1581253380, 1201608055, 85619372, -68842748, -1279064480, 2005250983, -307341145, 1996142013, 375123593, -271055130, -1781860008, 1096813866, 1849745898, 1007707851, -1605275342, -2140441286, 739923250, -704377305, -467115791, 1079222860, 242615640, -1837178453, 318613241, 347811431, -197558611, -2019686765, -980556544, 1553348267, 494206472, 1112036812, 1258750298, -842445917, 1544265955, -1912564262, -620488471, -889282158, 1299296056, 423665295, 1359890860, 1077172953, -73273843, -1659840926, 1392617912, -1081530607, 1303291967, 392392088, -2017022783, 1184793512, -1869570613, -955858860, 340061913, 618379975, 1011823494, -809881216, 1816787957, 1978588983, -1138006003, 2078237231, 1842692073, -620524373, -1715977758, -939991847, 1418466514, 1620817717, 1901794668, -1390883660, 1843164580, 1743133853, 578558002, -1932993837, -858994155, -1461717196, 1528030456, 1435696692, -648559285, -302632139, -1607714348, 223376167, 1711779466, 317524838, -1082127435, -1990228258, -668408596, 548540297, 1651542945, -1614026445, -1832238632, -1037581785, -1523665978, 600270447, -574372648, -763786315, 283393782, 1770243570, -734407698, -1703285931, -327559973, -1788065014, 960709480, -1814854069, -908948374, -436117987, 1682085334, -762279866, -183191368, 220080184, -57766241, -676428704, 1598532481, -1255434042, 1989286800, -1717498989, 1784442077, -1337246483, 1458785475, -1332638305, 145755964, -1074151148, 1287376035, 1362332800, 224035916, -23479538, -1409046242, -694125069, -566762324, -630866531, -347269928, 679566165, 276545043, 366390502, 288394184, -1914964681, -1286440751, -2020552257, 1678295557, -443199195, -1935636633, 2101386234, 818513443, -708582396, 1983248498, -1871954656, -161206170, -1859668546, -1151541471, 988479706, -1460631101, 971904816, -1519785494, -1915212800, -1888967964, -1802228876, -1296777115, 1201309406, -1531584106, 826582647, 118055960, -1132107069, -373631934, -1371339394, -1940516137, 1127749479, 1201351105, 68476456, -1744193508, -306861080, -980025384, -2072230927, -1736978617, 1572698384, 1177367976, -1156123924, 775840687, -1727327625, -38219474, -2063183380, -1110362267, 1684813422, -884896557, 1016574566, 803377337, 540645732, -1240017080, -1178332843, 2034593037, 1429295941, 1034344725, 1381736146, -62446596, -833249209, 1611256781, -1200401518, -518501295, 1572749265, -807863775, -746688917, 1656148124, -1201074141, 922162158, 302308805, 2079850451, 1040750617, 2011035759, 1436256879, 344405547, 1340950393, 1207010603, 1972919535, -2062377130, -975191328, -973132685, -1556578693, 931702417, -1990261158, 35115389, -1650124362, 500851691, -1315688156) 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\", \"activite\""} 
[2026-08-06 16:02:43] local.DEBUG: EstimationN1QueryBuilder {"context":"App\\Services\\Inventaire\\{closure}","mode":"fact","source_table":"observatoire.fact_estimation_n_1","filter_level":"reg","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.prg_2013_teqco2_pcaet_n1)::numeric, 4) AS prg_2013_teqco2_pcaet_n1, ROUND(SUM(fe1.prg_2021_teqco2_pcaet_n1)::numeric, 4) AS prg_2021_teqco2_pcaet_n1 from \"observatoire\".\"fact_estimation_n_1\" as \"fe1\" left join \"observatoire\".\"dim_territories\" as \"t\" on \"t\".\"type_id\" = 'reg' 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 (-891326525, -1770579410, 1184216008, 1334444297, 1101891219, 34632021, -678691896, 1983858355, 1898773849, -1473599555, 780402788, 29790987, 936707590, 1611746287, 597925454, 1021982571, 943680073, 1990695804, 90023422, -943236317, 606744683, 5512556, -1723422958, -730258373, -1395209334, -1458025857, 976323895, -632527496, 357382170, 904891896, 256557159, -1669310148, 552500236, 1666479923, -850150694, 2086919670, 1563733864, -979371203, -20355117, -1268018131, 973743027, -995169125, 1140099250, -878761160, -502440001, 911530169, 1544475574, 1822463447, 1669102578, -1422793355, 1035271978, 96936853, -1267554566, -525133160, -233704641, -295462746, -1476708338, 40556270, 1964844930, -2098664342, -1290362788, 1017406998, -500685670, 1505940645, 1990508546, 1698436250, -164560006, -2074645457, 1577096012, -146538989, 1477083024, -1489332138, -1230737330, 1850980260, 1297950547, -490173173, -1871040676, -230718315, -1145724480, -2024386565, -301501320, -1246092032, 1444672102, -1887945636, 1352314706, -192853748, 871304771, 1160589231, -1743838489, -1725457796, -206862964, -2131605619, -1166465414, -499232206, 1947155941, 1288967671, -30571893, 1681914496, 1724376841, 1721936645, -2075017474, -423920115, 1568998603, -1114102449, 1304264383, 89386497, 1858439910, -1657469405, 1625146943, -386983978, 725678735, 1124078917, -1535001764, -1225544777, 1938725061, -1109583266, 453902139, 96267702, 1567286384, -759148196, -1173720275, -1084802215, 106152301, -158020057, -583136926, -997374615, 1460014746, 1498312074, 1364024549, -208929306, 1281788198, 770984370, 1951885443, 1155146790, -405842380, -397915175, -321157205, 1813778841, 2043557197, 1078169907, -887098850, -305543184, -830399312, 1246073589, -2011014488, -1651325837, 586622372, -1488543839, -192306140) 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-08-06 16:02:43] local.DEBUG: EstimationN1QueryBuilder {"context":"App\\Services\\Inventaire\\{closure}","mode":"fact","source_table":"observatoire.fact_estimation_n_1","filter_level":"reg","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.prg_2013_teqco2_pcaet_n1)::numeric, 4) AS prg_2013_teqco2_pcaet_n1, ROUND(SUM(fe1.prg_2021_teqco2_pcaet_n1)::numeric, 4) AS prg_2021_teqco2_pcaet_n1 from \"observatoire\".\"fact_estimation_n_1\" as \"fe1\" left join \"observatoire\".\"dim_territories\" as \"t\" on \"t\".\"type_id\" = 'reg' 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 (-891326525, -1770579410, 1184216008, 1334444297, 1101891219, 34632021, -678691896, 1983858355, 1898773849, -1473599555, 780402788, 29790987, 936707590, 1611746287, 597925454, 1021982571, 943680073, 1990695804, 90023422, -943236317, 606744683, 5512556, -1723422958, -730258373, -1395209334, -1458025857, 976323895, -632527496, 357382170, 904891896, 256557159, -1669310148, 552500236, 1666479923, -850150694, 2086919670, 1563733864, -979371203, -20355117, -1268018131, 973743027, -995169125, 1140099250, -878761160, -502440001, 911530169, 1544475574, 1822463447, 1669102578, -1422793355, 1035271978, 96936853, -1267554566, -525133160, -233704641, -295462746, -1476708338, 40556270, 1964844930, -2098664342, -1290362788, 1017406998, -500685670, 1505940645, 1990508546, 1698436250, -164560006, -2074645457, 1577096012, -146538989, 1477083024, -1489332138, -1230737330, 1850980260, 1297950547, -490173173, -1871040676, -230718315, -1145724480, -2024386565, -301501320, -1246092032, 1444672102, -1887945636, 1352314706, -192853748, 871304771, 1160589231, -1743838489, -1725457796, -206862964, -2131605619, -1166465414, -499232206, 1947155941, 1288967671, -30571893, 1681914496, 1724376841, 1721936645, -2075017474, -423920115, 1568998603, -1114102449, 1304264383, 89386497, 1858439910, -1657469405, 1625146943, -386983978, 725678735, 1124078917, -1535001764, -1225544777, 1938725061, -1109583266, 453902139, 96267702, 1567286384, -759148196, -1173720275, -1084802215, 106152301, -158020057, -583136926, -997374615, 1460014746, 1498312074, 1364024549, -208929306, 1281788198, 770984370, 1951885443, 1155146790, -405842380, -397915175, -321157205, 1813778841, 2043557197, 1078169907, -887098850, -305543184, -830399312, 1246073589, -2011014488, -1651325837, 586622372, -1488543839, -192306140) 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-08-06 16:02:45] local.DEBUG: EstimationN1QueryBuilder {"context":"App\\Services\\Inventaire\\{closure}","mode":"fact","source_table":"observatoire.fact_estimation_n_1","filter_level":"reg","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.prg_2013_teqco2_pcaet_n1)::numeric, 4) AS prg_2013_teqco2_pcaet_n1, ROUND(SUM(fe1.prg_2021_teqco2_pcaet_n1)::numeric, 4) AS prg_2021_teqco2_pcaet_n1 from \"observatoire\".\"fact_estimation_n_1\" as \"fe1\" left join \"observatoire\".\"dim_territories\" as \"t\" on \"t\".\"type_id\" = 'reg' 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 (-891326525, -1770579410, 1184216008, 1334444297, 1101891219, 34632021, -678691896, 1983858355, 1898773849, -1473599555, 780402788, 29790987, 936707590, 1611746287, 597925454, 1021982571, 943680073, 1990695804, 90023422, -943236317, 606744683, 5512556, -1723422958, -730258373, -1395209334, -1458025857, 976323895, -632527496, 357382170, 904891896, 256557159, -1669310148, 552500236, 1666479923, -850150694, 2086919670, 1563733864, -979371203, -20355117, -1268018131, 973743027, -995169125, 1140099250, -878761160, -502440001, 911530169, 1544475574, 1822463447, 1669102578, -1422793355, 1035271978, 96936853, -1267554566, -525133160, -233704641, -295462746, -1476708338, 40556270, 1964844930, -2098664342, -1290362788, 1017406998, -500685670, 1505940645, 1990508546, 1698436250, -164560006, -2074645457, 1577096012, -146538989, 1477083024, -1489332138, -1230737330, 1850980260, 1297950547, -490173173, -1871040676, -230718315, -1145724480, -2024386565, -301501320, -1246092032, 1444672102, -1887945636, 1352314706, -192853748, 871304771, 1160589231, -1743838489, -1725457796, -206862964, -2131605619, -1166465414, -499232206, 1947155941, 1288967671, -30571893, 1681914496, 1724376841, 1721936645, -2075017474, -423920115, 1568998603, -1114102449, 1304264383, 89386497, 1858439910, -1657469405, 1625146943, -386983978, 725678735, 1124078917, -1535001764, -1225544777, 1938725061, -1109583266, 453902139, 96267702, 1567286384, -759148196, -1173720275, -1084802215, 106152301, -158020057, -583136926, -997374615, 1460014746, 1498312074, 1364024549, -208929306, 1281788198, 770984370, 1951885443, 1155146790, -405842380, -397915175, -321157205, 1813778841, 2043557197, 1078169907, -887098850, -305543184, -830399312, 1246073589, -2011014488, -1651325837, 586622372, -1488543839, -192306140) 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-08-06 16:09:40] local.DEBUG: SequestrationQueryBuilder {"context":"App\\Services\\Inventaire\\{closure}","mode":"fact","source_table":"observatoire.fact_sequestration","filter_level":"reg","display_level":null,"years":[2024,2023,2022,2021,2020,2019,2018,2017,2016,2015,2014,2012,2010,2005,1990],"sql":"select sq.year_id, COALESCE(t.name, '(non rattaché)') AS territoire, ROUND(SUM(sq.prg_2021_teqco2_utcatf)::numeric, 4) AS prg_2021_teqco2_utcatf from (select DISTINCT territory_id from \"observatoire\".\"dim_territory_memberships\" where \"parent_id\" in (936037254)) as communes inner join \"observatoire\".\"fact_sequestration\" as \"sq\" on \"sq\".\"geo_id\" = \"communes\".\"territory_id\" and \"sq\".\"year_id\" in (2024, 2023, 2022, 2021, 2020, 2019, 2018, 2017, 2016, 2015, 2014, 2012, 2010, 2005, 1990) left join \"observatoire\".\"dim_territory_memberships\" as \"dtm_d\" on \"dtm_d\".\"territory_id\" = \"sq\".\"geo_id\" and \"dtm_d\".\"parent_id\" in (936037254) left join \"observatoire\".\"dim_territories\" as \"t\" on \"t\".\"id\" = \"dtm_d\".\"parent_id\" group by \"sq\".\"year_id\", \"territoire\""} 
[2026-08-06 16:09:40] local.DEBUG: SequestrationQueryBuilder {"context":"App\\Services\\Inventaire\\{closure}","mode":"fact","source_table":"observatoire.fact_sequestration","filter_level":"reg","display_level":null,"years":[2024,2023,2022,2021,2020,2019,2018,2017,2016,2015,2014,2012,2010,2005,1990],"sql":"select sq.year_id, COALESCE(t.name, '(non rattaché)') AS territoire, ROUND(SUM(sq.prg_2021_teqco2_utcatf)::numeric, 4) AS prg_2021_teqco2_utcatf from (select DISTINCT territory_id from \"observatoire\".\"dim_territory_memberships\" where \"parent_id\" in (936037254)) as communes inner join \"observatoire\".\"fact_sequestration\" as \"sq\" on \"sq\".\"geo_id\" = \"communes\".\"territory_id\" and \"sq\".\"year_id\" in (2024, 2023, 2022, 2021, 2020, 2019, 2018, 2017, 2016, 2015, 2014, 2012, 2010, 2005, 1990) left join \"observatoire\".\"dim_territory_memberships\" as \"dtm_d\" on \"dtm_d\".\"territory_id\" = \"sq\".\"geo_id\" and \"dtm_d\".\"parent_id\" in (936037254) left join \"observatoire\".\"dim_territories\" as \"t\" on \"t\".\"id\" = \"dtm_d\".\"parent_id\" group by \"sq\".\"year_id\", \"territoire\""} 
[2026-08-06 16:09:45] local.DEBUG: SequestrationQueryBuilder {"context":"App\\Services\\Inventaire\\{closure}","mode":"fact","source_table":"observatoire.fact_sequestration","filter_level":"reg","display_level":null,"years":[2024,2023,2022,2021,2020,2019,2018,2017,2016,2015,2014,2012,2010,2005,1990],"sql":"select sq.year_id, COALESCE(t.name, '(non rattaché)') AS territoire, ROUND(SUM(sq.prg_2021_teqco2_utcatf)::numeric, 4) AS prg_2021_teqco2_utcatf from (select DISTINCT territory_id from \"observatoire\".\"dim_territory_memberships\" where \"parent_id\" in (936037254)) as communes inner join \"observatoire\".\"fact_sequestration\" as \"sq\" on \"sq\".\"geo_id\" = \"communes\".\"territory_id\" and \"sq\".\"year_id\" in (2024, 2023, 2022, 2021, 2020, 2019, 2018, 2017, 2016, 2015, 2014, 2012, 2010, 2005, 1990) left join \"observatoire\".\"dim_territory_memberships\" as \"dtm_d\" on \"dtm_d\".\"territory_id\" = \"sq\".\"geo_id\" and \"dtm_d\".\"parent_id\" in (936037254) left join \"observatoire\".\"dim_territories\" as \"t\" on \"t\".\"id\" = \"dtm_d\".\"parent_id\" group by \"sq\".\"year_id\", \"territoire\""} 
