explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 29p

Settings
# exclusive inclusive rows x rows loops node
1. 2.323 2,499.877 ↑ 121.5 7,377 1

Sort (cost=443,407.06..445,647.17 rows=896,045 width=55) (actual time=2,499.543..2,499.877 rows=7,377 loops=1)

  • Sort Key: (sum((sbc.importet - sbc.importei))) DESC
  • Sort Method: quicksort Memory: 775kB
2. 2.788 2,497.554 ↑ 121.5 7,377 1

GroupAggregate (cost=301,789.00..324,190.12 rows=896,045 width=55) (actual time=2,494.450..2,497.554 rows=7,377 loops=1)

  • Group Key: sbc.conta_02, f34_027204_25.apell_25
3. 1.890 2,494.766 ↑ 121.5 7,377 1

Sort (cost=301,789.00..304,029.11 rows=896,045 width=87) (actual time=2,494.443..2,494.766 rows=7,377 loops=1)

  • Sort Key: sbc.conta_02, f34_027204_25.apell_25
  • Sort Method: quicksort Memory: 781kB
4. 11.346 2,492.876 ↑ 121.5 7,377 1

Merge Join (cost=152,375.45..170,322.06 rows=896,045 width=87) (actual time=2,478.187..2,492.876 rows=7,377 loops=1)

  • Merge Cond: ((btrim((sbc.conta_02)::text)) = (btrim((f34_027204_25.clpro_25)::text)))
5. 2.000 2,106.875 ↓ 2.9 7,377 1

Sort (cost=138,823.09..138,829.51 rows=2,571 width=72) (actual time=2,106.567..2,106.875 rows=7,377 loops=1)

  • Sort Key: (btrim((sbc.conta_02)::text))
  • Sort Method: quicksort Memory: 769kB
6. 1.165 2,104.875 ↓ 2.9 7,377 1

Subquery Scan on sbc (cost=138,500.09..138,677.46 rows=2,571 width=72) (actual time=2,099.920..2,104.875 rows=7,377 loops=1)

7. 3.345 2,103.710 ↓ 2.9 7,377 1

GroupAggregate (cost=138,500.09..138,651.75 rows=2,571 width=72) (actual time=2,099.918..2,103.710 rows=7,377 loops=1)

  • Group Key: a1.conta_02
8. 9.703 2,100.365 ↓ 1.0 7,839 1

Sort (cost=138,500.09..138,518.94 rows=7,540 width=48) (actual time=2,099.912..2,100.365 rows=7,839 loops=1)

  • Sort Key: a1.conta_02
  • Sort Method: quicksort Memory: 805kB
9. 3.879 2,090.662 ↓ 1.0 7,839 1

Merge Left Join (cost=137,793.47..138,014.50 rows=7,540 width=48) (actual time=2,080.518..2,090.662 rows=7,839 loops=1)

  • Merge Cond: ((a1.seien_02 = f34_027204_02.seien_02) AND (a1.datmv_02 = f34_027204_02.datmv_02))
  • Join Filter: ((a1.diari_02)::text = (f34_027204_02.diari_02)::text)
10. 3.120 1,999.184 ↓ 1.0 7,839 1

Sort (cost=68,638.76..68,657.61 rows=7,540 width=30) (actual time=1,998.687..1,999.184 rows=7,839 loops=1)

  • Sort Key: a1.seien_02, a1.datmv_02
  • Sort Method: quicksort Memory: 805kB
11. 1.101 1,996.064 ↓ 1.0 7,839 1

Gather (cost=1,000.00..68,153.18 rows=7,540 width=30) (actual time=1,832.300..1,996.064 rows=7,839 loops=1)

  • Workers Planned: 4
  • Workers Launched: 4
12. 1,994.963 1,994.963 ↑ 1.2 1,568 5

Parallel Seq Scan on f34_027204_02 a1 (cost=0.00..66,399.18 rows=1,885 width=30) (actual time=1,830.573..1,994.963 rows=1,568 loops=5)

  • Filter: (((diari_02)::text = '1'::text) AND ((tipus_02)::text = 'C'::text) AND (datmv_02 >= to_date('01/01/2019'::text, 'DD/MM/YYYY'::text)) AND (datmv_02 <= to_date('31/12/2019'::text, 'D (...)
  • Rows Removed by Filter: 383334
13. 1.069 87.599 ↓ 2.3 7,839 1

Materialize (cost=69,154.70..69,301.90 rows=3,452 width=46) (actual time=81.826..87.599 rows=7,839 loops=1)

14. 4.195 86.530 ↓ 2.3 7,839 1

GroupAggregate (cost=69,154.70..69,258.75 rows=3,452 width=46) (actual time=81.822..86.530 rows=7,839 loops=1)

  • Group Key: f34_027204_02.seien_02, f34_027204_02.datmv_02, f34_027204_02.diari_02
15. 2.870 82.335 ↓ 2.3 7,839 1

Sort (cost=69,154.70..69,163.40 rows=3,480 width=22) (actual time=81.812..82.335 rows=7,839 loops=1)

  • Sort Key: f34_027204_02.seien_02, f34_027204_02.datmv_02
  • Sort Method: quicksort Memory: 805kB
16. 2.440 79.465 ↓ 2.3 7,839 1

Gather (cost=1,000.00..68,949.99 rows=3,480 width=22) (actual time=73.090..79.465 rows=7,839 loops=1)

  • Workers Planned: 4
  • Workers Launched: 4
17. 77.025 77.025 ↓ 1.8 1,568 5

Parallel Seq Scan on f34_027204_02 (cost=0.00..67,601.99 rows=870 width=22) (actual time=70.228..77.025 rows=1,568 loops=5)

  • Filter: (((conta_02)::text ~~ '47%'::text) AND ((tipus_02)::text = 'G'::text) AND ((diari_02)::text = '1'::text) AND (datmv_02 >= to_date('01/01/2019'::text, 'DD/MM/YYYY'::text (...)
  • Rows Removed by Filter: 383334
18. 99.387 374.655 ↑ 1.0 69,316 1

Sort (cost=13,552.36..13,726.62 rows=69,704 width=22) (actual time=371.610..374.655 rows=69,316 loops=1)

  • Sort Key: (btrim((f34_027204_25.clpro_25)::text))
  • Sort Method: quicksort Memory: 7760kB
19. 275.268 275.268 ↑ 1.0 69,704 1

Seq Scan on f34_027204_25 (cost=0.00..7,945.04 rows=69,704 width=22) (actual time=70.544..275.268 rows=69,704 loops=1)

Planning time : 467.644 ms
Execution time : 2,500.509 ms