explain.depesz.com

PostgreSQL's explain analyze made readable

Result: AdR

Settings
# exclusive inclusive rows x rows loops node
1. 0.004 0.257 ↑ 295.3 6 1

GroupAggregate (cost=208.34..252.64 rows=1,772 width=54) (actual time=0.255..0.257 rows=6 loops=1)

  • Group Key: cd.contract_end_date, cs.id, ((cd.contract_end_date - cd.activated))
2. 0.012 0.253 ↑ 295.3 6 1

Sort (cost=208.34..212.77 rows=1,772 width=54) (actual time=0.253..0.253 rows=6 loops=1)

  • Sort Key: cd.contract_end_date, cs.id, ((cd.contract_end_date - cd.activated))
  • Sort Method: quicksort Memory: 25kB
3. 0.009 0.241 ↑ 295.3 6 1

Hash Join (cost=34.77..112.73 rows=1,772 width=54) (actual time=0.123..0.241 rows=6 loops=1)

  • Hash Cond: (cd.company_id = cs.id)
4. 0.017 0.206 ↑ 9.4 14 1

Nested Loop (cost=32.73..105.71 rows=131 width=32) (actual time=0.091..0.206 rows=14 loops=1)

5. 0.005 0.077 ↑ 1.6 16 1

Hash Join (cost=32.45..36.36 rows=26 width=36) (actual time=0.056..0.077 rows=16 loops=1)

  • Hash Cond: (vm.plan_id = p.id)
6. 0.019 0.066 ↑ 1.6 16 1

Hash Join (cost=31.29..34.85 rows=26 width=32) (actual time=0.046..0.066 rows=16 loops=1)

  • Hash Cond: (vm.company_id = cd.company_id)
7. 0.012 0.012 ↑ 1.0 95 1

Seq Scan on virtual_machine vm (cost=0.00..2.95 rows=95 width=12) (actual time=0.004..0.012 rows=95 loops=1)

8. 0.005 0.035 ↑ 15.1 15 1

Hash (cost=28.45..28.45 rows=227 width=20) (actual time=0.035..0.035 rows=15 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
9. 0.030 0.030 ↑ 15.1 15 1

Seq Scan on company_dates cd (cost=0.00..28.45 rows=227 width=20) (actual time=0.012..0.030 rows=15 loops=1)

  • Filter: ((activated < (contract_end_date - '1 mon'::interval)) AND (contract_end_date <= (now() + '1 mon'::interval)))
  • Rows Removed by Filter: 32
10. 0.002 0.006 ↑ 1.0 7 1

Hash (cost=1.07..1.07 rows=7 width=12) (actual time=0.006..0.006 rows=7 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
11. 0.004 0.004 ↑ 1.0 7 1

Seq Scan on plan p (cost=0.00..1.07 rows=7 width=12) (actual time=0.003..0.004 rows=7 loops=1)

12. 0.112 0.112 ↑ 1.0 1 16

Index Scan using vs_vm_id on vm_status vs (cost=0.28..2.66 rows=1 width=4) (actual time=0.007..0.007 rows=1 loops=16)

  • Index Cond: (virtual_machine_id = vm.id)
  • Filter: (stop_date IS NULL)
  • Rows Removed by Filter: 16
13. 0.011 0.026 ↓ 1.0 37 1

Hash (cost=1.59..1.59 rows=36 width=22) (actual time=0.026..0.026 rows=37 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 10kB
14. 0.015 0.015 ↓ 1.0 37 1

Seq Scan on company_summary cs (cost=0.00..1.59 rows=36 width=22) (actual time=0.008..0.015 rows=37 loops=1)

  • Filter: (status_id = 1)
  • Rows Removed by Filter: 10
Planning time : 0.641 ms
Execution time : 0.316 ms