explain.depesz.com

PostgreSQL's explain analyze made readable

Result: kQD2

Settings
# exclusive inclusive rows x rows loops node
1. 0.011 5,807.829 ↑ 1.0 1 1

Nested Loop Left Join (cost=23,205.37..23,766.06 rows=1 width=557) (actual time=5,807.807..5,807.829 rows=1 loops=1)

2. 0.010 5,806.592 ↑ 1.0 1 1

Nested Loop Left Join (cost=23,204.94..23,762.60 rows=1 width=2,153) (actual time=5,806.571..5,806.592 rows=1 loops=1)

3. 0.008 5,646.661 ↑ 1.0 1 1

Nested Loop Left Join (cost=23,204.52..23,759.15 rows=1 width=1,149) (actual time=5,646.641..5,646.661 rows=1 loops=1)

4. 0.699 5,576.963 ↑ 1.0 1 1

Merge Right Join (cost=23,203.97..23,755.56 rows=1 width=1,125) (actual time=5,576.946..5,576.963 rows=1 loops=1)

  • Merge Cond: (msg.event_uuid = e.event_uuid)
5. 1.040 5,534.906 ↓ 158.6 10,941 1

Subquery Scan on msg (cost=23,184.85..23,736.25 rows=69 width=70) (actual time=5,524.097..5,534.906 rows=10,941 loops=1)

  • Filter: (msg.row_number = 1)
6. 7.884 5,533.866 ↑ 1.3 10,941 1

WindowAgg (cost=23,184.85..23,563.94 rows=13,785 width=117) (actual time=5,524.088..5,533.866 rows=10,941 loops=1)

7. 33.460 5,525.982 ↑ 1.3 10,942 1

Sort (cost=23,184.85..23,219.31 rows=13,785 width=77) (actual time=5,524.060..5,525.982 rows=10,942 loops=1)

  • Sort Key: m.event_uuid, (CASE m.language WHEN persons_org_part_default.language THEN 1 WHEN 'en'::text THEN 2 ELSE 3 END), m.language
  • Sort Method: quicksort Memory: 4734kB
8. 26.929 5,492.522 ↓ 1.2 16,429 1

Hash Left Join (cost=348.17..22,237.08 rows=13,785 width=77) (actual time=136.459..5,492.522 rows=16,429 loops=1)

  • Hash Cond: ((m.language)::text = (persons_org_part_default.language)::text)
9. 5,332.750 5,357.104 ↓ 1.2 16,429 1

Bitmap Heap Scan on messages_org_part_default m (cost=344.58..22,112.18 rows=13,785 width=73) (actual time=27.944..5,357.104 rows=16,429 loops=1)

  • Recheck Cond: (organization_uuid = 'e4194fdc-ee7a-4a10-8d46-875b73cbce9a'::uuid)
  • Filter: ((is_visible IS TRUE) AND (valid_range @> '2020-01-31 21:26:57+00'::timestamp with time zone))
  • Rows Removed by Filter: 326
  • Heap Blocks: exact=10955
10. 24.354 24.354 ↓ 1.0 16,755 1

Bitmap Index Scan on messages_org_part_default_msg_seq_vrange_uidx (cost=0.00..341.14 rows=16,228 width=0) (actual time=24.354..24.354 rows=16,755 loops=1)

  • Index Cond: (organization_uuid = 'e4194fdc-ee7a-4a10-8d46-875b73cbce9a'::uuid)
11. 0.022 108.489 ↑ 1.0 1 1

Hash (cost=3.58..3.58 rows=1 width=3) (actual time=108.488..108.489 rows=1 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
12. 108.467 108.467 ↑ 1.0 1 1

Index Scan using persons_org_part_default_per_seq_vrange_uidx on persons_org_part_default (cost=0.56..3.58 rows=1 width=3) (actual time=108.466..108.467 rows=1 loops=1)

  • Index Cond: ((organization_uuid = 'e4194fdc-ee7a-4a10-8d46-875b73cbce9a'::uuid) AND (person_uuid = 'f3b48ad7-2e40-49c8-a884-881fef1592c8'::uuid))
  • Filter: ((is_visible IS TRUE) AND (valid_range @> '2020-01-31 21:26:57+00'::timestamp with time zone))
  • Rows Removed by Filter: 170
13. 0.017 41.358 ↑ 1.0 1 1

Sort (cost=19.12..19.12 rows=1 width=1,071) (actual time=41.357..41.358 rows=1 loops=1)

  • Sort Key: e.event_uuid
  • Sort Method: quicksort Memory: 25kB
14. 41.341 41.341 ↑ 1.0 1 1

Index Scan using events_org_part_default_event_id_idx on events_org_part_default e (cost=0.43..19.11 rows=1 width=1,071) (actual time=40.300..41.341 rows=1 loops=1)

  • Index Cond: ((event_id)::text = '20835003'::text)
  • Filter: ((is_visible IS TRUE) AND (valid_range @> '2020-01-31 21:26:57+00'::timestamp with time zone) AND (organization_uuid = 'e4194fdc-ee7a-4a10-8d46-875b73cbce9a'::uuid))
  • Rows Removed by Filter: 5
15. 69.690 69.690 ↑ 1.0 1 1

Index Scan using persons_org_part_default_per_seq_vrange_uidx on persons_org_part_default p (cost=0.56..3.58 rows=1 width=40) (actual time=69.688..69.690 rows=1 loops=1)

  • Index Cond: ((organization_uuid = 'e4194fdc-ee7a-4a10-8d46-875b73cbce9a'::uuid) AND (person_uuid = e.submitter_uuid))
  • Filter: ((is_visible IS TRUE) AND (valid_range @> '2020-01-31 21:26:57+00'::timestamp with time zone))
  • Rows Removed by Filter: 166
16. 159.921 159.921 ↑ 1.0 1 1

Index Scan using forms_org_seq_vrange_uidx on forms f (cost=0.42..3.44 rows=1 width=1,020) (actual time=159.921..159.921 rows=1 loops=1)

  • Index Cond: ((organization_uuid = 'e4194fdc-ee7a-4a10-8d46-875b73cbce9a'::uuid) AND (form_uuid = e.form_uuid))
  • Filter: ((is_visible IS TRUE) AND (valid_range @> '2020-01-31 21:26:57+00'::timestamp with time zone))
  • Rows Removed by Filter: 7
17. 1.226 1.226 ↑ 1.0 1 1

Index Scan using plans_org_seq_vrange_uidx on plans pl (cost=0.43..3.45 rows=1 width=43) (actual time=1.225..1.226 rows=1 loops=1)

  • Index Cond: ((organization_uuid = 'e4194fdc-ee7a-4a10-8d46-875b73cbce9a'::uuid) AND (plan_uuid = e.plan_uuid))
  • Filter: ((is_visible IS TRUE) AND (valid_range @> '2020-01-31 21:26:57+00'::timestamp with time zone))
  • Rows Removed by Filter: 7
Planning time : 7.768 ms
Execution time : 5,809.137 ms