explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 3GVe : Get Event by ID

Settings
# exclusive inclusive rows x rows loops node
1. 0.017 11,946.317 ↑ 1,378.0 1 1

Nested Loop Left Join (cost=8,741.73..27,745.12 rows=1,378 width=528) (actual time=8,897.533..11,946.317 rows=1 loops=1)

2. 0.258 10,503.520 ↑ 3.0 1 1

Nested Loop Left Join (cost=8,741.18..26,632.71 rows=3 width=544) (actual time=7,454.737..10,503.520 rows=1 loops=1)

  • Join Filter: (msg.event_uuid = e.event_uuid)
  • Rows Removed by Join Filter: 2,681
3. 0.008 7,467.138 ↑ 3.0 1 1

Nested Loop Left Join (cost=246.77..17,986.96 rows=3 width=489) (actual time=4,420.105..7,467.138 rows=1 loops=1)

4. 0.011 7,311.525 ↑ 3.0 1 1

Nested Loop Left Join (cost=246.22..17,976.21 rows=3 width=461) (actual time=4,264.495..7,311.525 rows=1 loops=1)

5. 6,493.394 7,159.306 ↑ 3.0 1 1

Bitmap Heap Scan on events_org_part_default e (cost=245.80..17,965.85 rows=3 width=440) (actual time=4,112.280..7,159.306 rows=1 loops=1)

  • Recheck Cond: (organization_uuid = 'a2423b29-4fcb-44c4-88b8-bd2d86d56369'::uuid)
  • Filter: ((is_visible IS TRUE) AND (valid_range @> '2029-12-16 13:38:50+00'::timestamp with time zone) AND ((event_id)::text = '174988018'::text))
  • Rows Removed by Filter: 12,272
  • Heap Blocks: exact=7,445
6. 665.912 665.912 ↑ 1.1 12,295 1

Bitmap Index Scan on events_org_part_default_organization_uuid_expr_idx (cost=0.00..245.80 rows=12,916 width=0) (actual time=665.912..665.912 rows=12,295 loops=1)

  • Index Cond: (organization_uuid = 'a2423b29-4fcb-44c4-88b8-bd2d86d56369'::uuid)
7. 152.208 152.208 ↑ 1.0 1 1

Index Scan using forms_org_seq_vrange_uidx on forms f (cost=0.42..3.44 rows=1 width=37) (actual time=152.206..152.208 rows=1 loops=1)

  • Index Cond: ((organization_uuid = 'a2423b29-4fcb-44c4-88b8-bd2d86d56369'::uuid) AND (form_uuid = e.form_uuid))
  • Filter: ((is_visible IS TRUE) AND (valid_range @> '2029-12-16 13:38:50+00'::timestamp with time zone))
  • Rows Removed by Filter: 3
8. 155.605 155.605 ↑ 1.0 1 1

Index Scan using plans_org_seq_vrange_uidx on plans pl (cost=0.55..3.57 rows=1 width=44) (actual time=155.602..155.605 rows=1 loops=1)

  • Index Cond: ((organization_uuid = 'a2423b29-4fcb-44c4-88b8-bd2d86d56369'::uuid) AND (plan_uuid = e.plan_uuid))
  • Filter: ((is_visible IS TRUE) AND (valid_range @> '2029-12-16 13:38:50+00'::timestamp with time zone))
  • Rows Removed by Filter: 5
9. 0.755 3,036.124 ↓ 141.2 2,682 1

Materialize (cost=8,494.41..8,644.94 rows=19 width=71) (actual time=3,032.060..3,036.124 rows=2,682 loops=1)

10. 0.306 3,035.369 ↓ 141.2 2,682 1

Subquery Scan on msg (cost=8,494.41..8,644.85 rows=19 width=71) (actual time=3,032.053..3,035.369 rows=2,682 loops=1)

  • Filter: (msg.row_number = 1)
11. 30.247 3,035.063 ↑ 1.4 2,682 1

WindowAgg (cost=8,494.41..8,597.83 rows=3,761 width=118) (actual time=3,032.048..3,035.063 rows=2,682 loops=1)

12. 4.222 3,004.816 ↑ 1.4 2,682 1

Sort (cost=8,494.41..8,503.81 rows=3,761 width=78) (actual time=3,004.399..3,004.816 rows=2,682 loops=1)

  • Sort Key: m.event_uuid, (CASE m.language WHEN persons_org_part_8.language THEN 1 WHEN 'en'::text THEN 2 ELSE 3 END), m.language
  • Sort Method: quicksort Memory: 409kB
13. 3.889 3,000.594 ↑ 1.4 2,682 1

Hash Left Join (cost=1,023.64..8,271.06 rows=3,761 width=78) (actual time=1,363.771..3,000.594 rows=2,682 loops=1)

  • Hash Cond: ((m.language)::text = (persons_org_part_8.language)::text)
14. 1,634.158 2,300.710 ↑ 1.4 2,682 1

Bitmap Heap Scan on messages_org_part_default m (cost=656.15..7,869.72 rows=3,761 width=74) (actual time=667.744..2,300.710 rows=2,682 loops=1)

  • Recheck Cond: (organization_uuid = 'a2423b29-4fcb-44c4-88b8-bd2d86d56369'::uuid)
  • Filter: ((is_visible IS TRUE) AND (valid_range @> '2029-12-16 13:38:50+00'::timestamp with time zone))
  • Rows Removed by Filter: 2,435
  • Heap Blocks: exact=1,785
15. 666.552 666.552 ↓ 1.0 5,117 1

Bitmap Index Scan on messages_org_part_default_msg_seq_vrange_uidx (cost=0.00..655.21 rows=4,887 width=0) (actual time=666.551..666.552 rows=5,117 loops=1)

  • Index Cond: (organization_uuid = 'a2423b29-4fcb-44c4-88b8-bd2d86d56369'::uuid)
16. 0.015 695.995 ↑ 5.0 1 1

Hash (cost=367.43..367.43 rows=5 width=3) (actual time=695.995..695.995 rows=1 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
17. 695.980 695.980 ↑ 5.0 1 1

Index Scan using persons_org_part_8_per_seq_vrange_uidx on persons_org_part_8 (cost=0.56..367.43 rows=5 width=3) (actual time=695.979..695.980 rows=1 loops=1)

  • Index Cond: (person_uuid = '9f4c35ed-c44d-4f28-8628-50a9be309c2d'::uuid)
  • Filter: ((is_visible IS TRUE) AND (valid_range @> '2029-12-16 13:38:50+00'::timestamp with time zone) AND (organization_uuid = 'a2423b29-4fcb-44c4-88b8-bd2d86d56369'::uuid))
  • Rows Removed by Filter: 50
18. 1,442.780 1,442.780 ↑ 5.0 1 1

Index Scan using persons_org_part_8_per_seq_vrange_uidx on persons_org_part_8 p (cost=0.56..368.46 rows=5 width=41) (actual time=1,442.779..1,442.780 rows=1 loops=1)

  • Index Cond: (person_uuid = e.submitter_uuid)
  • Filter: ((is_visible IS TRUE) AND (valid_range @> '2029-12-16 13:38:50+00'::timestamp with time zone) AND (organization_uuid = 'a2423b29-4fcb-44c4-88b8-bd2d86d56369'::uuid))
  • Rows Removed by Filter: 135
Planning time : 384.062 ms
Execution time : 11,947.154 ms