explain.depesz.com

PostgreSQL's explain analyze made readable

Result: SgCFD

Settings
# exclusive inclusive rows x rows loops node
1. 31.667 1,338.109 ↑ 1.6 67 1

HashAggregate (cost=1,491.47..1,492.56 rows=109 width=12) (actual time=1,337.582..1,338.109 rows=67 loops=1)

  • Group Key: servicing_servicecontract.service_id
2. 513.000 1,306.442 ↑ 3.4 3,920 1

Hash Join (cost=6.86..1,424.44 rows=13,407 width=4) (actual time=3.227..1,306.442 rows=3,920 loops=1)

  • Hash Cond: (servicing_servicecontract.service_id = servicing_service.id)
  • Join Filter: (SubPlan 1)
  • Rows Removed by Join Filter: 24846
3. 215.172 215.172 ↑ 1.0 28,775 1

Seq Scan on servicing_servicecontract (cost=0.00..788.75 rows=28,775 width=8) (actual time=0.011..215.172 rows=28,775 loops=1)

4. 1.477 2.950 ↓ 1.0 126 1

Hash (cost=5.32..5.32 rows=123 width=16) (actual time=2.943..2.950 rows=126 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 14kB
5. 1.473 1.473 ↓ 1.0 126 1

Seq Scan on servicing_service (cost=0.00..5.32 rows=123 width=16) (actual time=0.011..1.473 rows=126 loops=1)

  • Filter: ((frequency IS NOT NULL) AND ("interval" IS NOT NULL))
  • Rows Removed by Filter: 6
6.          

SubPlan (for Hash Join)

7. 575.320 575.320 ↓ 0.0 0 28,766

Function Scan on generate_series ts (cost=0.07..25.07 rows=5 width=0) (actual time=0.020..0.020 rows=0 loops=28,766)

  • Filter: (date_trunc('month'::text, ((ts)::date)::timestamp with time zone) = date_trunc('month'::text, ('2019-12-01'::date)::timestamp with time zone))
  • Rows Removed by Filter: 10
Planning time : 0.724 ms
Execution time : 1,338.768 ms