explain.depesz.com

PostgreSQL's explain analyze made readable

Result: m4bv

Settings
# exclusive inclusive rows x rows loops node
1. 0.034 0.738 ↑ 2.8 70 1

Nested Loop (cost=45.96..159.96 rows=194 width=166) (actual time=0.451..0.738 rows=70 loops=1)

2. 0.017 0.634 ↑ 2.8 70 1

Nested Loop (cost=45.67..97.50 rows=194 width=128) (actual time=0.442..0.634 rows=70 loops=1)

3. 0.119 0.581 ↑ 2.8 4 1

Hash Join (cost=45.39..82.20 rows=11 width=120) (actual time=0.430..0.581 rows=4 loops=1)

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

Seq Scan on inspections_bookingtemplatehistory bth (cost=0.00..32.42 rows=1,142 width=116) (actual time=0.008..0.117 rows=1,148 loops=1)

5. 0.000 0.345 ↑ 2.8 4 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
6. 0.003 0.345 ↑ 2.8 4 1

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

  • Group Key: "ANY_subquery".id
7. 0.000 0.342 ↑ 2.8 4 1

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

8. 0.005 0.342 ↑ 2.8 4 1

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

  • Group Key: bth_1.booking_template_id
9. 0.013 0.337 ↓ 1.9 21 1

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

  • Sort Key: bth_1.booking_template_id
  • Sort Method: quicksort Memory: 25kB
10. 0.078 0.324 ↓ 1.9 21 1

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

  • Hash Cond: (bth_1.booking_template_id = bt.id)
11. 0.189 0.189 ↓ 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.189 rows=872 loops=1)

  • Filter: (booking_form IS NOT NULL)
  • Rows Removed by Filter: 276
12. 0.001 0.057 ↑ 1.0 4 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
13. 0.056 0.056 ↑ 1.0 4 1

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

  • Filter: (org_id = 252437)
  • Rows Removed by Filter: 313
14. 0.036 0.036 ↑ 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=12) (actual time=0.006..0.009 rows=18 loops=4)

  • Index Cond: (bookingtemplatehistory_id = bth.id)
15. 0.070 0.070 ↑ 1.0 1 70

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

  • Index Cond: (id = bpl.productline_id)
Planning time : 0.921 ms
Execution time : 0.818 ms