explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 7jdH

Settings
# exclusive inclusive rows x rows loops node
1. 8.268 1,695.794 ↑ 1.0 1 1

Aggregate (cost=212,755.26..212,755.27 rows=1 width=8) (actual time=1,695.793..1,695.794 rows=1 loops=1)

2. 15.882 1,687.526 ↓ 3.2 39,732 1

Hash Join (cost=1,284.86..212,724.37 rows=12,354 width=4) (actual time=11.129..1,687.526 rows=39,732 loops=1)

  • Hash Cond: (c.time_zone_id = tz.id)
3. 17.094 1,671.613 ↓ 3.2 39,732 1

Hash Join (cost=1,282.94..212,686.67 rows=12,354 width=8) (actual time=11.091..1,671.613 rows=39,732 loops=1)

  • Hash Cond: (ce.contract_id = c.id)
4. 35.325 1,643.576 ↓ 3.2 39,732 1

Nested Loop (cost=0.72..211,372.01 rows=12,354 width=8) (actual time=0.123..1,643.576 rows=39,732 loops=1)

5. 12.424 1,568.519 ↓ 3.2 39,732 1

Nested Loop (cost=0.43..207,544.52 rows=12,354 width=12) (actual time=0.115..1,568.519 rows=39,732 loops=1)

6. 1,434.550 1,434.550 ↓ 3.3 40,515 1

Seq Scan on service_data_consumption sdcd (cost=0.00..130,718.12 rows=12,432 width=4) (actual time=0.104..1,434.550 rows=40,515 loops=1)

  • Filter: (((end_date)::date >= ((date_trunc('month'::text, now()) - '11 mons'::interval))::date) AND ((end_date)::date <= ((date_trunc('month'::text, now()) + '3 mons'::interval))::date))
  • Rows Removed by Filter: 2446027
7. 121.545 121.545 ↑ 1.0 1 40,515

Index Scan using pk_consumption_entity_id on consumption_entity ce (cost=0.43..6.18 rows=1 width=12) (actual time=0.003..0.003 rows=1 loops=40,515)

  • Index Cond: (id = sdcd.consumption_entity_id)
  • Filter: ((NOT deleted) AND (NOT saved_as_draft) AND (client_id = 1007))
  • Rows Removed by Filter: 0
8. 39.732 39.732 ↑ 1.0 1 39,732

Index Only Scan using pk_contract_service_data on contract_service_data csd (cost=0.29..0.31 rows=1 width=4) (actual time=0.001..0.001 rows=1 loops=39,732)

  • Index Cond: (id = ce.service_id)
  • Heap Fetches: 39732
9. 4.335 10.943 ↑ 1.0 13,032 1

Hash (cost=1,119.32..1,119.32 rows=13,032 width=8) (actual time=10.943..10.943 rows=13,032 loops=1)

  • Buckets: 16384 Batches: 1 Memory Usage: 638kB
10. 6.608 6.608 ↑ 1.0 13,032 1

Seq Scan on contract c (cost=0.00..1,119.32 rows=13,032 width=8) (actual time=0.003..6.608 rows=13,032 loops=1)

11. 0.015 0.031 ↑ 1.0 41 1

Hash (cost=1.41..1.41 rows=41 width=4) (actual time=0.031..0.031 rows=41 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 10kB
12. 0.016 0.016 ↑ 1.0 41 1

Seq Scan on time_zone tz (cost=0.00..1.41 rows=41 width=4) (actual time=0.006..0.016 rows=41 loops=1)