explain.depesz.com

PostgreSQL's explain analyze made readable

Result: uBTp

Settings
# exclusive inclusive rows x rows loops node
1. 0.006 581.190 ↑ 1.0 40 1

Limit (cost=72,315.07..72,316.17 rows=40 width=88) (actual time=581.147..581.190 rows=40 loops=1)

2. 0.034 581.184 ↑ 742.5 40 1

Unique (cost=72,315.07..73,131.77 rows=29,698 width=88) (actual time=581.146..581.184 rows=40 loops=1)

3. 55.380 581.150 ↑ 645.6 46 1

Sort (cost=72,315.07..72,389.32 rows=29,698 width=88) (actual time=581.143..581.150 rows=46 loops=1)

  • 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), t.labels, (COALESCE((pa.value)::bigint, '180'::bigint))
  • Sort Method: quicksort Memory: 14,571kB
4. 9.858 525.770 ↓ 2.9 86,966 1

Gather (cost=12,328.81..70,108.79 rows=29,698 width=88) (actual time=166.527..525.770 rows=86,966 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
5. 62.062 515.912 ↓ 2.3 28,989 3 / 3

Nested Loop Left Join (cost=11,328.81..65,879.13 rows=12,374 width=88) (actual time=177.790..515.912 rows=28,989 loops=3)

6. 5.313 308.907 ↓ 2.3 28,989 3 / 3

Nested Loop (cost=11,328.38..48,111.49 rows=12,374 width=687) (actual time=177.531..308.907 rows=28,989 loops=3)

7. 27.098 216.626 ↓ 2.2 28,989 3 / 3

Hash Join (cost=11,328.09..39,185.50 rows=13,457 width=80) (actual time=177.481..216.626 rows=28,989 loops=3)

  • Hash Cond: ((e.uid)::text = (eo.event_uid)::text)
8. 13.961 16.163 ↑ 1.4 27,060 3 / 3

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

  • 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[]))
  • Heap Blocks: exact=2,051
9. 2.202 2.202 ↑ 1.1 81,181 1 / 3

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

  • 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[]))
10. 44.964 173.365 ↑ 1.0 89,421 3 / 3

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

  • Buckets: 131,072 Batches: 1 Memory Usage: 14,385kB
11. 57.785 128.401 ↑ 1.0 89,421 3 / 3

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

  • Hash Cond: (eo.order_id = t.id)
12. 15.531 15.531 ↓ 1.0 100,772 3 / 3

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

13. 29.713 55.085 ↓ 1.0 85,317 3 / 3

Hash (cost=2,284.19..2,284.19 rows=83,019 width=72) (actual time=55.085..55.085 rows=85,317 loops=3)

  • Buckets: 131,072 Batches: 1 Memory Usage: 10,036kB
14. 25.372 25.372 ↓ 1.0 85,317 3 / 3

Seq Scan on order_v2 t (cost=0.00..2,284.19 rows=83,019 width=72) (actual time=0.027..25.372 rows=85,317 loops=3)

15. 86.968 86.968 ↑ 1.0 1 86,968 / 3

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

  • Index Cond: (order_id = eo.order_id)
16. 144.943 144.943 ↑ 1.0 1 86,966 / 3

Index Scan using idx_point_attribute_point_id on point_attribute pa (cost=0.43..1.41 rows=1 width=41) (actual time=0.003..0.005 rows=1 loops=86,966)

  • Index Cond: (point_id = (((r.data -> 0) ->> 'PointID'::text))::bigint)
  • Filter: ((key)::text = 'utc_offset'::text)
  • Rows Removed by Filter: 5
Planning time : 2.992 ms
Execution time : 581.887 ms