explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Hrsn

Settings
# exclusive inclusive rows x rows loops node
1. 0.000 0.000 ↓ 0.0

Limit (cost=176,185.50..176,187.40 rows=40 width=279) (actual rows= loops=)

2. 0.000 0.000 ↓ 0.0

Unique (cost=176,185.50..177,595.83 rows=29,691 width=279) (actual rows= loops=)

3. 0.000 0.000 ↓ 0.0

Sort (cost=176,185.50..176,259.73 rows=29,691 width=279) (actual rows= loops=)

  • Sort Key: t.created_at DESC, t.id, t.transport_type_id, t.organization_id, t.status_id, t.tariff_type, t.updated_at, ((((r.data -> 0) ->> 'Departure'::text))::timestamp without time zone), (array_agg(event_orders.event_uid)), ost.description, uact.user_id, ost.user_id, ((SubPlan 1)), (array_agg(order_carriages.carriage_id)), user_actions.user_id, t.labels, (array_agg(oa.org_service_id)), (COALESCE((pa.value)::bigint, '180'::bigint))
4. 0.000 0.000 ↓ 0.0

Merge Left Join (cost=96,130.73..173,979.80 rows=29,691 width=279) (actual rows= loops=)

  • Merge Cond: (t.id = oa.order_id)
5. 0.000 0.000 ↓ 0.0

Merge Left Join (cost=96,130.45..140,847.47 rows=29,691 width=855) (actual rows= loops=)

  • Merge Cond: (t.id = user_actions.entity_id)
6. 0.000 0.000 ↓ 0.0

Merge Left Join (cost=67,345.91..109,582.33 rows=29,691 width=847) (actual rows= loops=)

  • Merge Cond: (t.id = uact.entity_id)
7. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=51,053.53..92,765.93 rows=29,691 width=839) (actual rows= loops=)

  • Join Filter: (ost.order_id = t.id)
8. 0.000 0.000 ↓ 0.0

Gather Merge (cost=49,952.48..91,219.50 rows=29,691 width=784) (actual rows= loops=)

  • Workers Planned: 2
9. 0.000 0.000 ↓ 0.0

Merge Left Join (cost=48,952.46..86,792.40 rows=12,371 width=784) (actual rows= loops=)

  • Merge Cond: (t.id = order_carriages.order_id)
10. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=48,952.04..76,040.10 rows=12,371 width=752) (actual rows= loops=)

11. 0.000 0.000 ↓ 0.0

Merge Join (cost=48,951.61..58,460.94 rows=12,371 width=719) (actual rows= loops=)

  • Merge Cond: (eo.order_id = event_orders.order_id)
12. 0.000 0.000 ↓ 0.0

Sort (cost=48,951.32..48,982.24 rows=12,371 width=703) (actual rows= loops=)

  • Sort Key: t.id
13. 0.000 0.000 ↓ 0.0

Nested Loop (cost=11,328.38..48,110.42 rows=12,371 width=703) (actual rows= loops=)

14. 0.000 0.000 ↓ 0.0

Hash Join (cost=11,328.09..39,185.50 rows=13,457 width=80) (actual rows= loops=)

  • Hash Cond: ((e.uid)::text = (eo.event_uid)::text)
15. 0.000 0.000 ↓ 0.0

Parallel Bitmap Heap Scan on events_v2 e (cost=3,231.83..28,335.90 rows=37,411 width=33) (actual rows= loops=)

  • Recheck Cond: (init_point_id = ANY ('{3337,31249392,77918439,50677385,33935738,45134433,5,31048375,33949580,45089315,14,20,10289611,89099974,44009457,25565607,45074279,45074285,31276267,31545800,3341,8,71904711,37534833,6,9851,3339,16,2,31289745,35633224,23381011,6041,11,9837,24,89099969,15564683,31289741,77918440,77918441,43994469,46242075,33935735,32893134,31289740,62771745,15,8269152,4,9790310,46242072,50661657,32879486,12,31048376,6821844,37534836,19944229,46242073,37534835,68403069,31276270,31289734,31276271,3088539,120065980,31559341,43949531,16932574,33935739,31559332,71904712,37520704,16932573,46242063,46242066,25,74404560,50677383,33935736,68727005,62379851,4746,27,74404559,33935733,46242070,31289737,19,7,31289739,37534832,1,23,18,89099975,74804035,23381010,71904713,33949582,89099978,77566940,72464520,33949581,3455,44009459,46242067,3340,21,16233,71904708,71904710,68727006,28,29570928,33935734,71904709,31289732,89099979,50708850,32879487,37534831,9790308,46257354,32879483,25565605,45074276,9,31559335,54901057,13,5683,16932572,25565606,46242069,74804036,11841881,10,4597,20721486,12124137,31276280,31289738,31559323,23393397,26,31048378,20721485,43964497,33935737,37534834,31262830,22,31222544,3,3338,46242071,45089314,31276281,5209,33234808,31545799,31303216,31048377,89099977,43994470,72464519,5255,25565604,17,45029225,89099973,31559339,3454,31249395,31289742,120062930,31249393,31559342,31559328,31559344}'::bigint[]))
16. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on idx_views_events_v2_init_point_id (cost=0.00..3,209.38 rows=89,786 width=0) (actual rows= loops=)

  • Index Cond: (init_point_id = ANY ('{3337,31249392,77918439,50677385,33935738,45134433,5,31048375,33949580,45089315,14,20,10289611,89099974,44009457,25565607,45074279,45074285,31276267,31545800,3341,8,71904711,37534833,6,9851,3339,16,2,31289745,35633224,23381011,6041,11,9837,24,89099969,15564683,31289741,77918440,77918441,43994469,46242075,33935735,32893134,31289740,62771745,15,8269152,4,9790310,46242072,50661657,32879486,12,31048376,6821844,37534836,19944229,46242073,37534835,68403069,31276270,31289734,31276271,3088539,120065980,31559341,43949531,16932574,33935739,31559332,71904712,37520704,16932573,46242063,46242066,25,74404560,50677383,33935736,68727005,62379851,4746,27,74404559,33935733,46242070,31289737,19,7,31289739,37534832,1,23,18,89099975,74804035,23381010,71904713,33949582,89099978,77566940,72464520,33949581,3455,44009459,46242067,3340,21,16233,71904708,71904710,68727006,28,29570928,33935734,71904709,31289732,89099979,50708850,32879487,37534831,9790308,46257354,32879483,25565605,45074276,9,31559335,54901057,13,5683,16932572,25565606,46242069,74804036,11841881,10,4597,20721486,12124137,31276280,31289738,31559323,23393397,26,31048378,20721485,43964497,33935737,37534834,31262830,22,31222544,3,3338,46242071,45089314,31276281,5209,33234808,31545799,31303216,31048377,89099977,43994470,72464519,5255,25565604,17,45029225,89099973,31559339,3454,31249395,31289742,120062930,31249393,31559342,31559328,31559344}'::bigint[]))
17. 0.000 0.000 ↓ 0.0

Hash (cost=6,974.32..6,974.32 rows=89,755 width=113) (actual rows= loops=)

18. 0.000 0.000 ↓ 0.0

Hash Join (cost=3,321.93..6,974.32 rows=89,755 width=113) (actual rows= loops=)

  • Hash Cond: (eo.order_id = t.id)
19. 0.000 0.000 ↓ 0.0

Seq Scan on event_orders eo (cost=0.00..3,389.28 rows=100,228 width=41) (actual rows= loops=)

20. 0.000 0.000 ↓ 0.0

Hash (cost=2,284.19..2,284.19 rows=83,019 width=72) (actual rows= loops=)

21. 0.000 0.000 ↓ 0.0

Seq Scan on order_v2 t (cost=0.00..2,284.19 rows=83,019 width=72) (actual rows= loops=)

22. 0.000 0.000 ↓ 0.0

Index Scan using idx_route_order_id on route r (cost=0.29..0.65 rows=1 width=623) (actual rows= loops=)

  • Index Cond: (order_id = eo.order_id)
23. 0.000 0.000 ↓ 0.0

GroupAggregate (cost=0.29..8,165.23 rows=92,706 width=40) (actual rows= loops=)

  • Group Key: event_orders.order_id
24. 0.000 0.000 ↓ 0.0

Index Scan using idx_event_orders_order_id on event_orders (cost=0.29..6,505.27 rows=100,228 width=41) (actual rows= loops=)

25. 0.000 0.000 ↓ 0.0

Index Scan using idx_point_attribute_point_id on point_attribute pa (cost=0.43..1.41 rows=1 width=41) (actual rows= loops=)

  • Index Cond: (point_id = (((r.data -> 0) ->> 'PointID'::text))::bigint)
  • Filter: ((key)::text = 'utc_offset'::text)
26. 0.000 0.000 ↓ 0.0

GroupAggregate (cost=0.42..10,551.35 rows=12,153 width=40) (actual rows= loops=)

  • Group Key: order_carriages.order_id
27. 0.000 0.000 ↓ 0.0

Index Scan using order_carriages_order_id_carriage_id_uindex on order_carriages (cost=0.42..9,739.17 rows=132,054 width=16) (actual rows= loops=)

  • Filter: (NOT is_deleted)
28. 0.000 0.000 ↓ 0.0

Materialize (cost=1,101.05..1,101.07 rows=1 width=63) (actual rows= loops=)

29. 0.000 0.000 ↓ 0.0

Subquery Scan on ost (cost=1,101.05..1,101.06 rows=1 width=63) (actual rows= loops=)

30. 0.000 0.000 ↓ 0.0

Limit (cost=1,101.05..1,101.05 rows=1 width=71) (actual rows= loops=)

31. 0.000 0.000 ↓ 0.0

Sort (cost=1,101.05..1,114.33 rows=5,312 width=71) (actual rows= loops=)

  • Sort Key: os.created_at DESC
32. 0.000 0.000 ↓ 0.0

Seq Scan on order_status_transition os (cost=0.00..1,074.49 rows=5,312 width=71) (actual rows= loops=)

  • Filter: ((NOT is_deleted) AND (""to"" = 5))
33. 0.000 0.000 ↓ 0.0

Sort (cost=16,182.40..16,347.67 rows=66,109 width=16) (actual rows= loops=)

  • Sort Key: uact.entity_id
34. 0.000 0.000 ↓ 0.0

Seq Scan on user_actions uact (cost=0.00..10,889.52 rows=66,109 width=16) (actual rows= loops=)

  • Filter: (((entity)::text = 'order'::text) AND ((action)::text = 'Order create'::text))
35. 0.000 0.000 ↓ 0.0

Unique (cost=28,784.54..29,838.46 rows=84,443 width=24) (actual rows= loops=)

36. 0.000 0.000 ↓ 0.0

Sort (cost=28,784.54..29,311.50 rows=210,785 width=24) (actual rows= loops=)

  • Sort Key: user_actions.entity_id, user_actions.created_at DESC
37. 0.000 0.000 ↓ 0.0

Seq Scan on user_actions (cost=0.00..10,145.44 rows=210,785 width=24) (actual rows= loops=)

  • Filter: ((NOT is_deleted) AND ((entity)::text = 'order'::text))
38. 0.000 0.000 ↓ 0.0

GroupAggregate (cost=0.28..276.44 rows=2,945 width=40) (actual rows= loops=)

  • Group Key: oa.order_id
39. 0.000 0.000 ↓ 0.0

Index Scan using idx_order_additional_services_order_id on order_additional_services oa (cost=0.28..224.77 rows=2,971 width=16) (actual rows= loops=)

  • Filter: (NOT is_deleted)
40.          

SubPlan (for Merge Left Join)

41. 0.000 0.000 ↓ 0.0

Seq Scan on dict_reasons (cost=0.00..1.09 rows=1 width=32) (actual rows= loops=)

  • Filter: (id = ost.reason_id)