explain.depesz.com

PostgreSQL's explain analyze made readable

Result: CCj9

Settings
# exclusive inclusive rows x rows loops node
1. 0.007 7.848 ↓ 0.0 0 1

Nested Loop (cost=3.74..215.10 rows=1 width=487) (actual time=7.848..7.848 rows=0 loops=1)

  • Join Filter: (""overlaps""(x.contact_start_utc, x.contact_stop_utc, pdv.created_utc, pdv.completed_utc) AND (s.customer_id = pdv.customer_id))
2. 0.262 7.802 ↓ 13.0 13 1

Nested Loop (cost=3.32..214.24 rows=1 width=478) (actual time=4.654..7.802 rows=13 loops=1)

  • Join Filter: ((s.customer_id = t.customer_id) AND ((s.rtls_vendor_id)::text = (t.rtls_vendor_id)::text))
3. 0.230 5.955 ↓ 317.0 317 1

Nested Loop (cost=3.04..207.99 rows=1 width=753) (actual time=4.115..5.955 rows=317 loops=1)

4. 1.798 5.091 ↓ 317.0 317 1

Hash Join (cost=2.75..207.55 rows=1 width=730) (actual time=4.100..5.091 rows=317 loops=1)

  • Hash Cond: ((s.customer_id = x.customer_id) AND ((s.rtls_vendor_id)::text = (x.rtls_vendor_id)::text) AND ((s.sensor_value)::text = (x.sensor_value)::text))
5. 1.369 1.369 ↑ 1.0 5,158 1

Seq Scan on sensor s (cost=0.00..146.76 rows=5,158 width=14) (actual time=0.013..1.369 rows=5,158 loops=1)

  • Filter: (deleted_utc IS NULL)
  • Rows Removed by Filter: 18
6. 0.137 1.924 ↓ 3.2 317 1

Hash (cost=1.00..1.00 rows=100 width=940) (actual time=1.924..1.924 rows=317 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 34kB
7. 1.787 1.787 ↓ 3.2 317 1

Function Scan on json_to_recordset x (cost=0.00..1.00 rows=100 width=940) (actual time=1.695..1.787 rows=317 loops=1)

8. 0.634 0.634 ↑ 1.0 1 317

Index Scan using location_pk on location l (cost=0.28..0.43 rows=1 width=31) (actual time=0.001..0.002 rows=1 loops=317)

  • Index Cond: ((customer_id = s.customer_id) AND (id = s.location_id))
  • Filter: (deleted_utc IS NULL)
9. 1.585 1.585 ↓ 0.0 0 317

Index Scan using idx_tag_contacttrace on tag t (cost=0.29..6.23 rows=1 width=15) (actual time=0.005..0.005 rows=0 loops=317)

  • Index Cond: ((customer_id = x.customer_id) AND ((rtls_vendor_id)::text = (x.rtls_vendor_id)::text) AND ((tag_value)::text = (x.contact_tag_value)::text))
10. 0.039 0.039 ↓ 0.0 0 13

Index Scan using idx_patient_department_visit_contacttrace on patient_department_visit pdv (cost=0.41..0.82 rows=3 width=51) (actual time=0.003..0.003 rows=0 loops=13)

  • Index Cond: ((customer_id = t.customer_id) AND (tag_id = t.id))
  • Filter: (deleted_utc IS NULL)
Planning time : 2.616 ms
Execution time : 7.997 ms