explain.depesz.com

PostgreSQL's explain analyze made readable

Result: uPgG : Get Event by ID With Upper Inf

Settings
# exclusive inclusive rows x rows loops node
1. 0.112 72.443 ↑ 15,315.0 1 1

Nested Loop Left Join (cost=8,657.67..27,206.38 rows=15,315 width=528) (actual time=50.411..72.443 rows=1 loops=1)

2. 0.023 71.759 ↑ 2.0 1 1

Hash Left Join (cost=8,657.11..26,390.29 rows=2 width=544) (actual time=49.730..71.759 rows=1 loops=1)

  • Hash Cond: (e.event_uuid = msg.event_uuid)
3. 0.007 48.897 ↑ 2.0 1 1

Nested Loop Left Join (cost=246.77..17,979.92 rows=2 width=489) (actual time=26.870..48.897 rows=1 loops=1)

4. 0.019 48.806 ↑ 2.0 1 1

Nested Loop Left Join (cost=246.22..17,972.76 rows=2 width=461) (actual time=26.781..48.806 rows=1 loops=1)

5. 45.770 48.709 ↑ 2.0 1 1

Bitmap Heap Scan on events_org_part_default e (cost=245.80..17,965.85 rows=2 width=440) (actual time=26.688..48.709 rows=1 loops=1)

  • Recheck Cond: (organization_uuid = 'a2423b29-4fcb-44c4-88b8-bd2d86d56369'::uuid)
  • Filter: ((is_visible IS TRUE) AND upper_inf(valid_range) AND ((event_id)::text = '174988018'::text))
  • Rows Removed by Filter: 12272
  • Heap Blocks: exact=7445
6. 2.939 2.939 ↑ 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=2.939..2.939 rows=12,295 loops=1)

  • Index Cond: (organization_uuid = 'a2423b29-4fcb-44c4-88b8-bd2d86d56369'::uuid)
7. 0.078 0.078 ↑ 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=0.077..0.078 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 upper_inf(valid_range))
  • Rows Removed by Filter: 3
8. 0.084 0.084 ↑ 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=0.083..0.084 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 upper_inf(valid_range))
  • Rows Removed by Filter: 5
9. 1.029 22.839 ↓ 335.2 2,682 1

Hash (cost=8,410.25..8,410.25 rows=8 width=71) (actual time=22.839..22.839 rows=2,682 loops=1)

  • Buckets: 4096 (originally 1024) Batches: 1 (originally 1) Memory Usage: 241kB
10. 0.398 21.810 ↓ 335.2 2,682 1

Subquery Scan on msg (cost=8,345.13..8,410.25 rows=8 width=71) (actual time=18.059..21.810 rows=2,682 loops=1)

  • Filter: (msg.row_number = 1)
11. 3.055 21.412 ↓ 1.6 2,682 1

WindowAgg (cost=8,345.13..8,389.90 rows=1,628 width=118) (actual time=18.054..21.412 rows=2,682 loops=1)

12. 2.614 18.357 ↓ 1.6 2,682 1

Sort (cost=8,345.13..8,349.20 rows=1,628 width=78) (actual time=18.022..18.357 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. 1.435 15.743 ↓ 1.6 2,682 1

Hash Left Join (cost=1,024.03..8,258.28 rows=1,628 width=78) (actual time=1.992..15.743 rows=2,682 loops=1)

  • Hash Cond: ((m.language)::text = (persons_org_part_8.language)::text)
14. 12.617 13.987 ↓ 1.6 2,682 1

Bitmap Heap Scan on messages_org_part_default m (cost=655.61..7,869.18 rows=1,628 width=74) (actual time=1.652..13.987 rows=2,682 loops=1)

  • Recheck Cond: (organization_uuid = 'a2423b29-4fcb-44c4-88b8-bd2d86d56369'::uuid)
  • Filter: ((is_visible IS TRUE) AND upper_inf(valid_range))
  • Rows Removed by Filter: 2435
  • Heap Blocks: exact=1785
15. 1.370 1.370 ↓ 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=1.370..1.370 rows=5,117 loops=1)

  • Index Cond: (organization_uuid = 'a2423b29-4fcb-44c4-88b8-bd2d86d56369'::uuid)
16. 0.009 0.321 ↑ 79.0 1 1

Hash (cost=367.43..367.43 rows=79 width=3) (actual time=0.321..0.321 rows=1 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
17. 0.312 0.312 ↑ 79.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=79 width=3) (actual time=0.311..0.312 rows=1 loops=1)

  • Index Cond: (person_uuid = '9f4c35ed-c44d-4f28-8628-50a9be309c2d'::uuid)
  • Filter: ((is_visible IS TRUE) AND upper_inf(valid_range) AND (organization_uuid = 'a2423b29-4fcb-44c4-88b8-bd2d86d56369'::uuid))
  • Rows Removed by Filter: 50
18. 0.572 0.572 ↑ 80.0 1 1

Index Scan using persons_org_part_8_per_seq_vrange_uidx on persons_org_part_8 p (cost=0.56..368.96 rows=80 width=41) (actual time=0.571..0.572 rows=1 loops=1)

  • Index Cond: (person_uuid = e.submitter_uuid)
  • Filter: ((is_visible IS TRUE) AND upper_inf(valid_range) AND (organization_uuid = 'a2423b29-4fcb-44c4-88b8-bd2d86d56369'::uuid))
  • Rows Removed by Filter: 135
Planning time : 6.293 ms
Execution time : 73.042 ms