explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 2na0

Settings
# exclusive inclusive rows x rows loops node
1. 31.529 2,417.948 ↑ 1.0 1 1

Aggregate (cost=114,552.60..114,552.61 rows=1 width=0) (actual time=2,417.948..2,417.948 rows=1 loops=1)

2. 59.810 2,386.419 ↑ 1.0 100,046 1

Hash Left Join (cost=107,548.46..114,300.19 rows=100,966 width=0) (actual time=2,061.677..2,386.419 rows=100,046 loops=1)

  • Hash Cond: (i.id = insp.id_inspection)
3. 165.274 2,323.822 ↑ 1.0 100,046 1

Hash Join (cost=107,141.39..112,122.59 rows=100,966 width=8) (actual time=2,058.870..2,323.822 rows=100,046 loops=1)

  • Hash Cond: (i.id_customer = cust.id_customer)
4. 45.229 512.886 ↑ 1.0 100,046 1

Hash Right Join (cost=17,530.11..20,491.99 rows=100,966 width=16) (actual time=412.267..512.886 rows=100,046 loops=1)

  • Hash Cond: (inn.id_inspection = i.id)
5. 38.838 122.392 ↑ 5.1 1,308 1

Hash Join (cost=5,039.11..7,868.71 rows=6,614 width=8) (actual time=66.938..122.392 rows=1,308 loops=1)

  • Hash Cond: (inn.id_notification = n.id)
6. 27.139 27.139 ↑ 1.0 81,701 1

Seq Scan on notification inn (cost=0.00..1,942.23 rows=82,123 width=16) (actual time=0.015..27.139 rows=81,701 loops=1)

7. 5.149 56.415 ↑ 1.0 11,048 1

Hash (cost=4,896.15..4,896.15 rows=11,437 width=8) (actual time=56.415..56.415 rows=11,048 loops=1)

  • Buckets: 2048 Batches: 1 Memory Usage: 432kB
8. 51.266 51.266 ↑ 1.0 11,048 1

Seq Scan on notification n (cost=0.00..4,896.15 rows=11,437 width=8) (actual time=0.020..51.266 rows=11,048 loops=1)

  • Filter: ((ghost IS NOT TRUE) AND (status = 1))
  • Rows Removed by Filter: 128596
9. 42.289 345.265 ↑ 1.0 100,046 1

Hash (cost=11,228.93..11,228.93 rows=100,966 width=16) (actual time=345.265..345.265 rows=100,046 loops=1)

  • Buckets: 16384 Batches: 1 Memory Usage: 4690kB
10. 78.427 302.976 ↑ 1.0 100,046 1

Hash Right Join (cost=9,749.09..11,228.93 rows=100,966 width=16) (actual time=202.081..302.976 rows=100,046 loops=1)

  • Hash Cond: (inspection_note.id_inspection = i.id)
11. 74.987 130.245 ↓ 1.2 44,301 1

HashAggregate (cost=4,712.35..5,082.31 rows=36,996 width=8) (actual time=107.704..130.245 rows=44,301 loops=1)

  • Group Key: inspection_note.id_inspection
12. 55.258 55.258 ↑ 1.0 97,286 1

Seq Scan on inspection_note (cost=0.00..4,224.90 rows=97,490 width=8) (actual time=0.012..55.258 rows=97,286 loops=1)

  • Filter: (ghost IS NOT TRUE)
13. 44.693 94.304 ↑ 1.0 100,046 1

Hash (cost=3,774.66..3,774.66 rows=100,966 width=16) (actual time=94.304..94.304 rows=100,046 loops=1)

  • Buckets: 16384 Batches: 1 Memory Usage: 4690kB
14. 49.611 49.611 ↑ 1.0 100,046 1

Seq Scan on inspection i (cost=0.00..3,774.66 rows=100,966 width=16) (actual time=0.011..49.611 rows=100,046 loops=1)

15. 852.049 1,645.662 ↑ 1.1 1,531,085 1

Hash (cost=69,018.90..69,018.90 rows=1,647,390 width=8) (actual time=1,645.662..1,645.662 rows=1,531,085 loops=1)

  • Buckets: 262144 Batches: 1 Memory Usage: 59809kB
16. 793.613 793.613 ↑ 1.1 1,531,085 1

Seq Scan on cust (cost=0.00..69,018.90 rows=1,647,390 width=8) (actual time=0.008..793.613 rows=1,531,085 loops=1)

17. 0.079 2.787 ↑ 2.1 169 1

Hash (cost=402.55..402.55 rows=362 width=8) (actual time=2.787..2.787 rows=169 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 7kB
18. 2.708 2.708 ↑ 2.1 169 1

Seq Scan on inspection_period insp (cost=0.00..402.55 rows=362 width=8) (actual time=2.410..2.708 rows=169 loops=1)

  • Filter: (ghost IS NOT TRUE)
  • Rows Removed by Filter: 11421
Planning time : 1.279 ms
Execution time : 2,436.331 ms