explain.depesz.com

PostgreSQL's explain analyze made readable

Result: BAWU

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

Hash Left Join (cost=44,790.01..1,909,730.31 rows=10,243 width=628) (actual rows= loops=)

  • Hash Cond: (q1.tariff_id = dt.id)
2. 0.000 0.000 ↓ 0.0

Hash Left Join (cost=44,785.21..1,909,519.82 rows=10,243 width=621) (actual rows= loops=)

  • Hash Cond: (adc.user_id = abld.driver_id)
3. 0.000 0.000 ↓ 0.0

Hash Right Join (cost=44,780.81..1,909,386.11 rows=10,243 width=617) (actual rows= loops=)

  • Hash Cond: ((q1.user_id = ddc.driver_id) AND (q1.project_id = usr.project_id))
4. 0.000 0.000 ↓ 0.0

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

5. 0.000 0.000 ↓ 0.0

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

  • Merge Cond: (u_1.id = h_tariffs.driver_id)
  • Join Filter: (h_tariffs.project_id = p.id)
6. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.42..92,917.68 rows=6,329,265 width=8) (actual rows= loops=)

7. 0.000 0.000 ↓ 0.0

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

8. 0.000 0.000 ↓ 0.0

Materialize (cost=0.00..5.23 rows=15 width=4) (actual rows= loops=)

9. 0.000 0.000 ↓ 0.0

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

10. 0.000 0.000 ↓ 0.0

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

11. 0.000 0.000 ↓ 0.0

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

12. 0.000 0.000 ↓ 0.0

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

13. 0.000 0.000 ↓ 0.0

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

  • Sort Key: h_tariffs.driver_id, h_tariffs.project_id, h_tariffs.update_date DESC
14. 0.000 0.000 ↓ 0.0

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

15. 0.000 0.000 ↓ 0.0

Hash (cost=43,778.89..43,778.89 rows=10,243 width=613) (actual rows= loops=)

16. 0.000 0.000 ↓ 0.0

Merge Right Join (cost=7,343.14..43,778.89 rows=10,243 width=613) (actual rows= loops=)

  • Merge Cond: (u.id = ddc.driver_id)
17. 0.000 0.000 ↓ 0.0

Merge Left Join (cost=2,851.81..23,095.50 rows=421,951 width=36) (actual rows= loops=)

  • Merge Cond: (u.id = t.user_id)
  • Join Filter: (t.balance_type = dbt.id)
18. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.56..19,079.23 rows=421,951 width=8) (actual rows= loops=)

19. 0.000 0.000 ↓ 0.0

Index Only Scan using users_pk on users u (cost=0.42..13,796.68 rows=421,951 width=4) (actual rows= loops=)

20. 0.000 0.000 ↓ 0.0

Materialize (cost=0.14..8.17 rows=1 width=4) (actual rows= loops=)

21. 0.000 0.000 ↓ 0.0

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

  • Index Cond: (id = 1)
22. 0.000 0.000 ↓ 0.0

Sort (cost=2,851.25..2,866.98 rows=6,294 width=40) (actual rows= loops=)

  • Sort Key: t.user_id
23. 0.000 0.000 ↓ 0.0

HashAggregate (cost=2,312.49..2,391.16 rows=6,294 width=40) (actual rows= loops=)

  • Group Key: t.user_id, t.balance_type
24. 0.000 0.000 ↓ 0.0

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

  • Filter: (balance_type = 1)
25. 0.000 0.000 ↓ 0.0

Materialize (cost=4,491.32..19,646.16 rows=10,243 width=581) (actual rows= loops=)

26. 0.000 0.000 ↓ 0.0

Merge Left Join (cost=4,491.32..19,620.55 rows=10,243 width=581) (actual rows= loops=)

  • Merge Cond: (ddc.driver_id = usr.id)
27. 0.000 0.000 ↓ 0.0

Merge Left Join (cost=4,490.90..4,742.54 rows=10,243 width=418) (actual rows= loops=)

  • Merge Cond: (ddc.driver_id = adc.user_id)
28. 0.000 0.000 ↓ 0.0

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

  • Sort Key: ddc.driver_id
29. 0.000 0.000 ↓ 0.0

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

  • Hash Cond: (dcr.model_id = dcm.id)
30. 0.000 0.000 ↓ 0.0

Hash Left Join (cost=308.58..745.16 rows=10,243 width=303) (actual rows= loops=)

  • Hash Cond: (dcr.color_id = dcp.id)
31. 0.000 0.000 ↓ 0.0

Hash Left Join (cost=302.24..597.98 rows=10,243 width=23) (actual rows= loops=)

  • Hash Cond: (ddc.car_id = dcr.id)
32. 0.000 0.000 ↓ 0.0

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

33. 0.000 0.000 ↓ 0.0

Hash (cost=174.33..174.33 rows=10,233 width=19) (actual rows= loops=)

34. 0.000 0.000 ↓ 0.0

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

35. 0.000 0.000 ↓ 0.0

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

36. 0.000 0.000 ↓ 0.0

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

  • Hash Cond: (dca.color_short_id = dcs.id)
37. 0.000 0.000 ↓ 0.0

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

  • Hash Cond: (dcp.color_asterisk_id = dca.id)
38. 0.000 0.000 ↓ 0.0

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

39. 0.000 0.000 ↓ 0.0

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

40. 0.000 0.000 ↓ 0.0

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

41. 0.000 0.000 ↓ 0.0

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

42. 0.000 0.000 ↓ 0.0

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

43. 0.000 0.000 ↓ 0.0

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

44. 0.000 0.000 ↓ 0.0

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

  • Hash Cond: (dcm.brand_id = dcb.id)
45. 0.000 0.000 ↓ 0.0

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

46. 0.000 0.000 ↓ 0.0

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

47. 0.000 0.000 ↓ 0.0

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

48. 0.000 0.000 ↓ 0.0

Sort (cost=2,801.92..2,851.36 rows=19,776 width=97) (actual rows= loops=)

  • Sort Key: adc.user_id
49. 0.000 0.000 ↓ 0.0

Seq Scan on driver_card adc (cost=0.00..1,390.76 rows=19,776 width=97) (actual rows= loops=)

50. 0.000 0.000 ↓ 0.0

Index Scan using users_pk on users usr (cost=0.42..13,796.68 rows=421,951 width=167) (actual rows= loops=)

51. 0.000 0.000 ↓ 0.0

Hash (cost=3.73..3.73 rows=54 width=12) (actual rows= loops=)

52. 0.000 0.000 ↓ 0.0

Subquery Scan on abld (cost=2.65..3.73 rows=54 width=12) (actual rows= loops=)

53. 0.000 0.000 ↓ 0.0

HashAggregate (cost=2.65..3.19 rows=54 width=12) (actual rows= loops=)

  • Group Key: black_list_driver.driver_id
54. 0.000 0.000 ↓ 0.0

Seq Scan on black_list_driver (cost=0.00..2.38 rows=54 width=4) (actual rows= loops=)

  • Filter: ((blocked_from <= now()) AND ((blocked_until IS NULL) OR (blocked_until > now())))
55. 0.000 0.000 ↓ 0.0

Hash (cost=3.80..3.80 rows=80 width=8) (actual rows= loops=)

56. 0.000 0.000 ↓ 0.0

Seq Scan on d_tariffs dt (cost=0.00..3.80 rows=80 width=8) (actual rows= loops=)