explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 9UTA

Settings
# exclusive inclusive rows x rows loops node
1. 0.021 0.798 ↑ 48.5 4 1

HashAggregate (cost=160.93..162.87 rows=194 width=26) (actual time=0.797..0.798 rows=4 loops=1)

  • Group Key: bth.booking_template_id, bth.name
2. 0.007 0.777 ↑ 2.8 70 1

Nested Loop (cost=45.96..159.96 rows=194 width=26) (actual time=0.484..0.777 rows=70 loops=1)

3. 0.015 0.630 ↑ 2.8 70 1

Nested Loop (cost=45.67..97.50 rows=194 width=30) (actual time=0.466..0.630 rows=70 loops=1)

4. 0.126 0.583 ↑ 2.8 4 1

Hash Join (cost=45.39..82.20 rows=11 width=34) (actual time=0.455..0.583 rows=4 loops=1)

  • Hash Cond: (bth.id = "ANY_subquery".id)
5. 0.089 0.089 ↓ 1.0 1,148 1

Seq Scan on inspections_bookingtemplatehistory bth (cost=0.00..32.42 rows=1,142 width=30) (actual time=0.009..0.089 rows=1,148 loops=1)

6. 0.002 0.368 ↑ 2.8 4 1

Hash (cost=45.25..45.25 rows=11 width=4) (actual time=0.368..0.368 rows=4 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
7. 0.004 0.366 ↑ 2.8 4 1

HashAggregate (cost=45.14..45.25 rows=11 width=4) (actual time=0.365..0.366 rows=4 loops=1)

  • Group Key: "ANY_subquery".id
8. 0.002 0.362 ↑ 2.8 4 1

Subquery Scan on ANY_subquery (cost=44.81..45.11 rows=11 width=4) (actual time=0.358..0.362 rows=4 loops=1)

9. 0.005 0.360 ↑ 2.8 4 1

GroupAggregate (cost=44.81..45.00 rows=11 width=8) (actual time=0.358..0.360 rows=4 loops=1)

  • Group Key: bth_1.booking_template_id
10. 0.007 0.355 ↓ 1.9 21 1

Sort (cost=44.81..44.84 rows=11 width=8) (actual time=0.355..0.355 rows=21 loops=1)

  • Sort Key: bth_1.booking_template_id
  • Sort Method: quicksort Memory: 25kB
11. 0.094 0.348 ↓ 1.9 21 1

Hash Join (cost=8.84..44.62 rows=11 width=8) (actual time=0.087..0.348 rows=21 loops=1)

  • Hash Cond: (bth_1.booking_template_id = bt.id)
12. 0.206 0.206 ↓ 1.0 872 1

Seq Scan on inspections_bookingtemplatehistory bth_1 (cost=0.00..32.42 rows=867 width=8) (actual time=0.003..0.206 rows=872 loops=1)

  • Filter: (booking_form IS NOT NULL)
  • Rows Removed by Filter: 276
13. 0.003 0.048 ↑ 1.0 4 1

Hash (cost=8.79..8.79 rows=4 width=4) (actual time=0.048..0.048 rows=4 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
14. 0.045 0.045 ↑ 1.0 4 1

Seq Scan on inspections_bookingtemplate bt (cost=0.00..8.79 rows=4 width=4) (actual time=0.016..0.045 rows=4 loops=1)

  • Filter: (org_id = 252437)
  • Rows Removed by Filter: 313
15. 0.032 0.032 ↑ 1.1 18 4

Index Scan using inspections_bookingtemplat_bookingtemplatehistory_id_ff2c0fe0 on inspections_bookingtemplatehistory_product_lines bpl (cost=0.29..1.20 rows=19 width=8) (actual time=0.005..0.008 rows=18 loops=4)

  • Index Cond: (bookingtemplatehistory_id = bth.id)
16. 0.140 0.140 ↑ 1.0 1 70

Index Only Scan using datasource_productline_pkey on datasource_productline pl (cost=0.28..0.31 rows=1 width=4) (actual time=0.002..0.002 rows=1 loops=70)

  • Index Cond: (id = bpl.productline_id)
  • Heap Fetches: 70
Planning time : 0.714 ms
Execution time : 0.872 ms