explain.depesz.com

PostgreSQL's explain analyze made readable

Result: DoKw

Settings
# exclusive inclusive rows x rows loops node
1. 0.020 4,721.910 ↑ 1.0 50 1

Limit (cost=22,023.39..40,615.92 rows=50 width=628) (actual time=1,709.912..4,721.910 rows=50 loops=1)

2. 0.309 4,721.890 ↑ 204.9 50 1

Nested Loop Left Join (cost=22,023.39..3,830,888.81 rows=10,243 width=628) (actual time=1,709.911..4,721.890 rows=50 loops=1)

3. 0.279 4,721.231 ↑ 204.9 50 1

Nested Loop Left Join (cost=22,023.25..3,829,173.93 rows=10,243 width=621) (actual time=1,709.893..4,721.231 rows=50 loops=1)

  • Join Filter: (abld.driver_id = adc.user_id)
  • Rows Removed by Join Filter: 2,271
4. 0.220 4,720.752 ↑ 204.9 50 1

Nested Loop Left Join (cost=22,020.60..3,820,874.02 rows=10,243 width=617) (actual time=1,709.819..4,720.752 rows=50 loops=1)

5. 7.354 3,544.332 ↑ 204.9 50 1

Hash Right Join (cost=19,698.02..1,884,263.32 rows=10,243 width=585) (actual time=1,414.889..3,544.332 rows=50 loops=1)

  • Hash Cond: ((q1.user_id = ddc.driver_id) AND (q1.project_id = usr.project_id))
6. 1.087 2,125.233 ↑ 2,160.2 2,930 1

Subquery Scan on q1 (cost=47.27..1,754,572.07 rows=6,329,265 width=12) (actual time=2.136..2,125.233 rows=2,930 loops=1)

7. 1,944.518 2,124.146 ↑ 2,160.2 2,930 1

Merge Left Join (cost=47.27..1,691,279.42 rows=6,329,265 width=16) (actual time=2.135..2,124.146 rows=2,930 loops=1)

  • Merge Cond: (u_1.id = h_tariffs.driver_id)
  • Join Filter: (h_tariffs.project_id = p.id)
8. 0.940 179.228 ↑ 2,160.2 2,930 1

Nested Loop (cost=0.42..92,917.68 rows=6,329,265 width=8) (actual time=0.059..179.228 rows=2,930 loops=1)

9. 177.504 177.504 ↑ 2,152.8 196 1

Index Only Scan using users_pk on users u_1 (cost=0.42..13,796.68 rows=421,951 width=4) (actual time=0.037..177.504 rows=196 loops=1)

  • Heap Fetches: 196
10. 0.755 0.784 ↑ 1.0 15 196

Materialize (cost=0.00..5.23 rows=15 width=4) (actual time=0.000..0.004 rows=15 loops=196)

11. 0.029 0.029 ↑ 1.0 15 1

Seq Scan on projects p (cost=0.00..5.15 rows=15 width=4) (actual time=0.008..0.029 rows=15 loops=1)

12. 0.004 0.400 ↑ 580.0 1 1

Materialize (cost=46.85..71.53 rows=580 width=12) (actual time=0.400..0.400 rows=1 loops=1)

13. 0.001 0.396 ↑ 580.0 1 1

Unique (cost=46.85..64.28 rows=580 width=24) (actual time=0.396..0.396 rows=1 loops=1)

14. 0.017 0.395 ↑ 634.0 1 1

WindowAgg (cost=46.85..61.11 rows=634 width=24) (actual time=0.395..0.395 rows=1 loops=1)

15. 0.226 0.378 ↑ 634.0 1 1

Sort (cost=46.85..48.43 rows=634 width=20) (actual time=0.378..0.378 rows=1 loops=1)

  • Sort Key: h_tariffs.driver_id, h_tariffs.project_id, h_tariffs.update_date DESC
  • Sort Method: quicksort Memory: 74kB
16. 0.152 0.152 ↑ 1.0 634 1

Seq Scan on h_tariffs (cost=0.00..17.34 rows=634 width=20) (actual time=0.024..0.152 rows=634 loops=1)

17. 11.273 1,411.745 ↑ 1.0 10,112 1

Hash (cost=18,736.10..18,736.10 rows=10,243 width=581) (actual time=1,411.745..1,411.745 rows=10,112 loops=1)

  • Buckets: 8,192 Batches: 2 Memory Usage: 1,542kB
18. 140.619 1,400.472 ↑ 1.0 10,112 1

Merge Left Join (cost=3,656.08..18,736.10 rows=10,243 width=581) (actual time=279.518..1,400.472 rows=10,112 loops=1)

  • Merge Cond: (ddc.driver_id = usr.id)
19. 8.215 408.407 ↑ 1.0 10,112 1

Merge Left Join (cost=3,655.65..3,858.09 rows=10,243 width=418) (actual time=279.484..408.407 rows=10,112 loops=1)

  • Merge Cond: (ddc.driver_id = adc.user_id)
20. 124.281 269.231 ↑ 1.0 10,112 1

Sort (cost=1,688.98..1,714.59 rows=10,243 width=321) (actual time=149.895..269.231 rows=10,112 loops=1)

  • Sort Key: ddc.driver_id
  • Sort Method: quicksort Memory: 2,083kB
21. 3.335 144.950 ↑ 1.0 10,112 1

Hash Left Join (cost=429.25..1,006.68 rows=10,243 width=321) (actual time=47.418..144.950 rows=10,112 loops=1)

  • Hash Cond: (dcr.model_id = dcm.id)
22. 2.712 140.090 ↑ 1.0 10,112 1

Hash Left Join (cost=308.58..745.16 rows=10,243 width=303) (actual time=45.866..140.090 rows=10,112 loops=1)

  • Hash Cond: (dcr.color_id = dcp.id)
23. 3.344 137.236 ↑ 1.0 10,112 1

Hash Left Join (cost=302.24..597.98 rows=10,243 width=23) (actual time=45.689..137.236 rows=10,112 loops=1)

  • Hash Cond: (ddc.car_id = dcr.id)
24. 88.290 88.290 ↑ 1.0 10,112 1

Seq Scan on car_driver ddc (cost=0.00..166.43 rows=10,243 width=8) (actual time=0.012..88.290 rows=10,112 loops=1)

25. 43.469 45.602 ↓ 1.0 10,344 1

Hash (cost=174.33..174.33 rows=10,233 width=19) (actual time=45.602..45.602 rows=10,344 loops=1)

  • Buckets: 16,384 Batches: 1 Memory Usage: 652kB
26. 2.133 2.133 ↓ 1.0 10,344 1

Seq Scan on cars dcr (cost=0.00..174.33 rows=10,233 width=19) (actual time=0.010..2.133 rows=10,344 loops=1)

27. 0.015 0.142 ↑ 1.0 43 1

Hash (cost=5.80..5.80 rows=43 width=282) (actual time=0.142..0.142 rows=43 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 13kB
28. 0.017 0.127 ↑ 1.0 43 1

Hash Left Join (cost=3.30..5.80 rows=43 width=282) (actual time=0.105..0.127 rows=43 loops=1)

  • Hash Cond: (dca.color_short_id = dcs.id)
29. 0.054 0.093 ↑ 1.0 43 1

Hash Left Join (cost=1.97..3.93 rows=43 width=204) (actual time=0.080..0.093 rows=43 loops=1)

  • Hash Cond: (dcp.color_asterisk_id = dca.id)
30. 0.013 0.013 ↑ 1.0 43 1

Seq Scan on d_colors_pts dcp (cost=0.00..1.43 rows=43 width=122) (actual time=0.010..0.013 rows=43 loops=1)

31. 0.013 0.026 ↑ 1.0 43 1

Hash (cost=1.43..1.43 rows=43 width=88) (actual time=0.026..0.026 rows=43 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 11kB
32. 0.013 0.013 ↑ 1.0 43 1

Seq Scan on d_colors_asterisk dca (cost=0.00..1.43 rows=43 width=88) (actual time=0.008..0.013 rows=43 loops=1)

33. 0.006 0.017 ↑ 1.0 15 1

Hash (cost=1.15..1.15 rows=15 width=84) (actual time=0.017..0.017 rows=15 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
34. 0.011 0.011 ↑ 1.0 15 1

Seq Scan on d_colors_short dcs (cost=0.00..1.15 rows=15 width=84) (actual time=0.009..0.011 rows=15 loops=1)

35. 0.533 1.525 ↑ 1.0 2,770 1

Hash (cost=86.05..86.05 rows=2,770 width=22) (actual time=1.525..1.525 rows=2,770 loops=1)

  • Buckets: 4,096 Batches: 1 Memory Usage: 186kB
36. 0.598 0.992 ↑ 1.0 2,770 1

Hash Left Join (cost=3.59..86.05 rows=2,770 width=22) (actual time=0.058..0.992 rows=2,770 loops=1)

  • Hash Cond: (dcm.brand_id = dcb.id)
37. 0.355 0.355 ↑ 1.0 2,770 1

Seq Scan on d_models dcm (cost=0.00..47.70 rows=2,770 width=15) (actual time=0.008..0.355 rows=2,770 loops=1)

38. 0.023 0.039 ↑ 1.0 115 1

Hash (cost=2.15..2.15 rows=115 width=11) (actual time=0.039..0.039 rows=115 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 14kB
39. 0.016 0.016 ↑ 1.0 115 1

Seq Scan on d_brands dcb (cost=0.00..2.15 rows=115 width=11) (actual time=0.005..0.016 rows=115 loops=1)

40. 121.808 130.961 ↓ 1.0 10,112 1

Sort (cost=1,966.68..1,991.95 rows=10,111 width=97) (actual time=129.581..130.961 rows=10,112 loops=1)

  • Sort Key: adc.user_id
  • Sort Method: quicksort Memory: 1,885kB
41. 9.153 9.153 ↓ 1.0 10,112 1

Seq Scan on driver_card adc (cost=0.00..1,294.11 rows=10,111 width=97) (actual time=0.013..9.153 rows=10,112 loops=1)

42. 851.446 851.446 ↑ 1.0 420,013 1

Index Scan using users_pk on users usr (cost=0.42..13,796.68 rows=421,951 width=167) (actual time=0.018..851.446 rows=420,013 loops=1)

43. 107.250 1,176.200 ↑ 1.0 1 50

Hash Right Join (cost=2,322.58..2,511.41 rows=1 width=36) (actual time=23.523..23.524 rows=1 loops=50)

  • Hash Cond: ((t.balance_type = dbt.id) AND (t.user_id = u.id))
44. 710.354 978.950 ↑ 1.1 5,711 50

HashAggregate (cost=2,312.49..2,391.16 rows=6,294 width=40) (actual time=5.849..19.579 rows=5,711 loops=50)

  • Group Key: t.user_id, t.balance_type
45. 268.596 268.596 ↓ 1.0 62,583 1

Seq Scan on h_transactions t (cost=0.00..1,843.81 rows=62,490 width=12) (actual time=0.011..268.596 rows=62,583 loops=1)

  • Filter: (balance_type = 1)
  • Rows Removed by Filter: 463
46. 0.100 90.000 ↑ 1.0 1 50

Hash (cost=10.08..10.08 rows=1 width=8) (actual time=1.800..1.800 rows=1 loops=50)

  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
47. 0.150 89.900 ↑ 1.0 1 50

Nested Loop (cost=0.56..10.08 rows=1 width=8) (actual time=1.797..1.798 rows=1 loops=50)

48. 0.600 0.600 ↑ 1.0 1 50

Index Only Scan using users_pk on users u (cost=0.42..1.91 rows=1 width=4) (actual time=0.011..0.012 rows=1 loops=50)

  • Index Cond: (id = ddc.driver_id)
  • Heap Fetches: 50
49. 89.150 89.150 ↑ 1.0 1 50

Index Only Scan using d_balance_types_pkey on d_balance_types dbt (cost=0.14..8.16 rows=1 width=4) (actual time=1.783..1.783 rows=1 loops=50)

  • Index Cond: (id = 1)
  • Heap Fetches: 50
50. 0.148 0.200 ↑ 1.2 45 50

Materialize (cost=2.65..4.00 rows=54 width=12) (actual time=0.001..0.004 rows=45 loops=50)

51. 0.005 0.052 ↑ 1.2 46 1

Subquery Scan on abld (cost=2.65..3.73 rows=54 width=12) (actual time=0.041..0.052 rows=46 loops=1)

52. 0.019 0.047 ↑ 1.2 46 1

HashAggregate (cost=2.65..3.19 rows=54 width=12) (actual time=0.040..0.047 rows=46 loops=1)

  • Group Key: black_list_driver.driver_id
53. 0.028 0.028 ↑ 1.2 46 1

Seq Scan on black_list_driver (cost=0.00..2.38 rows=54 width=4) (actual time=0.017..0.028 rows=46 loops=1)

  • Filter: ((blocked_from <= now()) AND ((blocked_until IS NULL) OR (blocked_until > now())))
  • Rows Removed by Filter: 13
54. 0.350 0.350 ↑ 1.0 1 50

Index Scan using d_tariffs_pk on d_tariffs dt (cost=0.14..0.16 rows=1 width=8) (actual time=0.007..0.007 rows=1 loops=50)

  • Index Cond: (id = q1.tariff_id)
Planning time : 19.203 ms
Execution time : 4,873.335 ms