explain.depesz.com

PostgreSQL's explain analyze made readable

Result: G0hk

Settings
# exclusive inclusive rows x rows loops node
1. 0.036 3,484.012 ↓ 244.0 244 1

Unique (cost=3,741.53..3,741.53 rows=1 width=36) (actual time=3,483.955..3,484.012 rows=244 loops=1)

2. 0.647 3,483.976 ↓ 244.0 244 1

Sort (cost=3,741.53..3,741.53 rows=1 width=36) (actual time=3,483.953..3,483.976 rows=244 loops=1)

  • Sort Key: b.id
  • Sort Method: quicksort Memory: 36kB
3. 1,717.241 3,483.329 ↓ 244.0 244 1

Nested Loop (cost=29.43..3,741.52 rows=1 width=36) (actual time=21.842..3,483.329 rows=244 loops=1)

4. 0.706 35.112 ↓ 247.0 247 1

Nested Loop (cost=29.14..3,741.18 rows=1 width=8) (actual time=5.200..35.112 rows=247 loops=1)

5. 0.313 29.466 ↓ 247.0 247 1

Nested Loop (cost=28.72..3,732.69 rows=1 width=4) (actual time=5.179..29.466 rows=247 loops=1)

6. 0.036 0.036 ↓ 11.0 11 1

Index Scan using inspections_inspectiontype_code_org_id_5597f9ce_uniq on inspections_inspectiontype t (cost=0.28..8.30 rows=1 width=4) (actual time=0.015..0.036 rows=11 loops=1)

  • Index Cond: ((code)::text = 'TPR'::text)
7. 27.676 29.117 ↓ 22.0 22 11

Bitmap Heap Scan on inspections_booking b (cost=28.43..3,724.38 rows=1 width=8) (actual time=0.511..2.647 rows=22 loops=11)

  • Recheck Cond: (inspection_type_id = t.id)
  • Filter: ((book_to_org_id IS NOT NULL) AND (inspection_uuid IS NOT NULL) AND (inspection_uploaded_date >= '2020-06-01 00:00:00+00'::timestamp with time zone) AND (inspection_uploaded_date <= '2020-06-07 00:00:00+00'::timestamp with time zone) AND (upper((inspection_result)::text) = ANY ('{PASS,FAIL}'::text[])) AND (upper((inspection_status)::text) = 'COMPLETED'::text))
  • Rows Removed by Filter: 973
  • Heap Blocks: exact=8,754
8. 1.441 1.441 ↑ 1.0 1,057 11

Bitmap Index Scan on inspections_booking_inspection_type_id_50201154 (cost=0.00..28.43 rows=1,068 width=0) (actual time=0.131..0.131 rows=1,057 loops=11)

  • Index Cond: (inspection_type_id = t.id)
9. 4.940 4.940 ↑ 1.0 1 247

Index Only Scan using inspections_reportshare_booking_id_share_by_org__39c3abc4_uniq on inspections_reportshare s (cost=0.42..8.49 rows=1 width=4) (actual time=0.017..0.020 rows=1 loops=247)

  • Index Cond: ((booking_id = b.id) AND (share_to_org_id = 252,437))
  • Heap Fetches: 247
10. 1,730.976 1,730.976 ↑ 1.0 1 247

Index Scan using inspections_bookingppmquestionnaire_booking_id_key on inspections_bookingppmquestionnaire q (cost=0.29..0.32 rows=1 width=31) (actual time=7.000..7.008 rows=1 loops=247)

  • Index Cond: (booking_id = s.booking_id)
  • Filter: ((questionnaire IS NOT NULL) AND (answered_questionnaire IS NOT NULL) AND (((questionnaire)::json ->> 'id'::text) IS NOT NULL))
  • Rows Removed by Filter: 0
Planning time : 1.006 ms
Execution time : 3,484.111 ms