explain.depesz.com

PostgreSQL's explain analyze made readable

Result: PLkK

Settings
# exclusive inclusive rows x rows loops node
1. 5.549 41,884.825 ↑ 1.9 55,649 1

Subquery Scan on intercompany_to_pl1 (cost=1,079,819.59..4,690,840.96 rows=106,233 width=40) (actual time=41,806.582..41,884.825 rows=55,649 loops=1)

2. 782.212 41,879.276 ↑ 1.9 55,649 1

HashSetOp Intersect (cost=1,079,819.59..4,689,778.63 rows=106,233 width=8) (actual time=41,806.581..41,879.276 rows=55,649 loops=1)

3. 226.049 41,097.064 ↓ 17.2 3,654,500 1

Append (cost=1,079,819.59..4,689,247.46 rows=212,466 width=8) (actual time=4,991.225..41,097.064 rows=3,654,500 loops=1)

4. 87.698 6,784.093 ↓ 10.3 1,093,922 1

Subquery Scan on *SELECT* 1 (cost=1,079,819.59..1,153,180.51 rows=106,233 width=8) (actual time=4,991.224..6,784.093 rows=1,093,922 loops=1)

5. 123.979 6,696.395 ↓ 10.3 1,093,922 1

Unique (cost=1,079,819.59..1,151,055.85 rows=106,233 width=4) (actual time=4,991.223..6,696.395 rows=1,093,922 loops=1)

6. 171.164 6,572.416 ↑ 1.8 1,105,040 1

Subquery Scan on mouvementswithpool (cost=1,079,819.59..1,145,991.18 rows=2,025,869 width=4) (actual time=4,991.223..6,572.416 rows=1,105,040 loops=1)

  • Filter: (mouvementswithpool.sum_montant_signe_par_pool IS DISTINCT FROM '0'::numeric)
  • Rows Removed by Filter: 977793
7. 1,113.698 6,401.252 ↓ 1.0 2,082,833 1

WindowAgg (cost=1,079,819.59..1,120,540.57 rows=2,036,049 width=368) (actual time=4,991.221..6,401.252 rows=2,082,833 loops=1)

8. 711.559 5,287.554 ↓ 1.0 2,082,833 1

Sort (cost=1,079,819.59..1,084,909.71 rows=2,036,049 width=18) (actual time=4,991.209..5,287.554 rows=2,082,833 loops=1)

  • Sort Key: mouvementswithpool0.ecritures_id
  • Sort Method: quicksort Memory: 211874kB
9. 4,575.995 4,575.995 ↓ 1.0 2,082,833 1

Seq Scan on mouvementswithpool0 (cost=0.00..866,468.73 rows=2,036,049 width=18) (actual time=6.757..4,575.995 rows=2,082,833 loops=1)

  • Filter: (pool_name = 'Intercompany'::text)
  • Rows Removed by Filter: 25198147
10. 193.693 34,086.922 ↓ 24.1 2,560,578 1

Subquery Scan on *SELECT* 2 (cost=3,532,879.96..3,536,066.95 rows=106,233 width=8) (actual time=33,148.672..34,086.922 rows=2,560,578 loops=1)

11. 3,662.971 33,893.229 ↓ 24.1 2,560,578 1

HashAggregate (cost=3,532,879.96..3,533,942.29 rows=106,233 width=4) (actual time=33,148.670..33,893.229 rows=2,560,578 loops=1)

  • Group Key: mouvementswithpool_1.ecritures_id
12. 1,433.941 30,230.258 ↓ 1.1 15,909,163 1

Subquery Scan on mouvementswithpool_1 (cost=3,012,320.22..3,495,869.81 rows=14,804,057 width=4) (actual time=17,821.530..30,230.258 rows=15,909,163 loops=1)

  • Filter: (mouvementswithpool_1.sum_montant_signe_par_pool IS DISTINCT FROM '0'::numeric)
  • Rows Removed by Filter: 90076
13. 7,615.318 28,796.317 ↓ 1.1 15,999,239 1

WindowAgg (cost=3,012,320.22..3,309,889.20 rows=14,878,449 width=368) (actual time=17,821.527..28,796.317 rows=15,999,239 loops=1)

14. 15,123.378 21,180.999 ↓ 1.1 15,999,239 1

Sort (cost=3,012,320.22..3,049,516.34 rows=14,878,449 width=18) (actual time=17,821.514..21,180.999 rows=15,999,239 loops=1)

  • Sort Key: mouvementswithpool0_1.pool_name, mouvementswithpool0_1.ecritures_id
  • Sort Method: external merge Disk: 438840kB
15. 6,057.621 6,057.621 ↓ 1.1 15,999,239 1

Seq Scan on mouvementswithpool0 mouvementswithpool0_1 (cost=0.00..934,670.47 rows=14,878,449 width=18) (actual time=0.051..6,057.621 rows=15,999,239 loops=1)

  • Filter: ((pool_name = 'Expenses'::text) OR (pool_name = 'Income'::text))
  • Rows Removed by Filter: 11281741
Planning time : 0.607 ms