explain.depesz.com

PostgreSQL's explain analyze made readable

Result: X15z

Settings
# exclusive inclusive rows x rows loops node
1. 0.100 12.666 ↑ 1.0 1 1

Nested Loop Left Join (cost=10.55..45,118.58 rows=1 width=374) (actual time=12.656..12.666 rows=1 loops=1)

  • Join Filter: (tarifi.id = orders.klass)
  • Rows Removed by Join Filter: 18
2.          

Initplan (for Nested Loop Left Join)

3. 0.000 0.000 ↓ 0.0 0

Index Scan using opt_opt_key on opt (cost=0.28..8.29 rows=1 width=16) (never executed)

  • Index Cond: ((opt)::text = 'order_creating_over'::text)
4. 0.002 0.039 ↑ 1.0 1 1

Nested Loop Left Join (cost=2.26..39.16 rows=1 width=371) (actual time=0.031..0.039 rows=1 loops=1)

5. 0.001 0.030 ↑ 1.0 1 1

Nested Loop Left Join (cost=1.85..34.05 rows=1 width=318) (actual time=0.025..0.030 rows=1 loops=1)

6. 0.003 0.024 ↑ 1.0 1 1

Nested Loop Left Join (cost=1.56..33.66 rows=1 width=286) (actual time=0.020..0.024 rows=1 loops=1)

7. 0.002 0.017 ↑ 1.0 1 1

Nested Loop Left Join (cost=1.27..25.35 rows=1 width=239) (actual time=0.014..0.017 rows=1 loops=1)

8. 0.005 0.015 ↑ 1.0 1 1

Nested Loop (cost=1.12..17.17 rows=1 width=211) (actual time=0.013..0.015 rows=1 loops=1)

9. 0.008 0.008 ↑ 1.0 1 1

Index Scan using orders_id_pk on orders orders_1 (cost=0.56..8.58 rows=1 width=141) (actual time=0.007..0.008 rows=1 loops=1)

  • Index Cond: (id = 22204667)
10. 0.002 0.002 ↑ 1.0 1 1

Index Scan using orders_id_pk on orders (cost=0.56..8.58 rows=1 width=74) (actual time=0.001..0.002 rows=1 loops=1)

  • Index Cond: (id = 22204667)
11. 0.000 0.000 ↓ 0.0 0 1

Index Scan using client_podarok_kod_pkey on client_podarok_kod (cost=0.15..8.17 rows=1 width=36) (actual time=0.000..0.000 rows=0 loops=1)

  • Index Cond: (id = orders.id_podarka)
12. 0.004 0.004 ↑ 1.0 1 1

Index Scan using bort_id_pk on bort (cost=0.29..8.31 rows=1 width=51) (actual time=0.003..0.004 rows=1 loops=1)

  • Index Cond: (id = COALESCE(CASE WHEN (orders.id_bort > 0) THEN orders.id_bort ELSE NULL::integer END, orders.id_bort_vzyal))
13. 0.005 0.005 ↑ 1.0 1 1

Index Scan using car_id_pk on car (cost=0.29..0.38 rows=1 width=44) (actual time=0.004..0.005 rows=1 loops=1)

  • Index Cond: (id = bort.id_car)
14. 0.007 0.007 ↑ 1.0 1 1

Index Scan using driver_id_pk on driver (cost=0.41..5.10 rows=1 width=61) (actual time=0.005..0.007 rows=1 loops=1)

  • Index Cond: (id = bort.id_driver)
15. 0.006 0.006 ↑ 1.0 19 1

Seq Scan on tarifi (cost=0.00..6.19 rows=19 width=7) (actual time=0.000..0.006 rows=19 loops=1)

16.          

SubPlan (for Nested Loop Left Join)

17. 0.006 3.676 ↑ 1.0 1 1

Subquery Scan on bort_s_klientom (cost=1.42..22,530.61 rows=1 width=4) (actual time=3.676..3.676 rows=1 loops=1)

  • Filter: (orders_1.id = bort_s_klientom.id_order)
  • Rows Removed by Filter: 27
18. 0.052 3.670 ↑ 9.7 28 1

HashSetOp Except (cost=1.42..22,527.21 rows=272 width=8) (actual time=3.669..3.670 rows=28 loops=1)

19. 0.026 3.618 ↑ 1.0 387 1

Append (cost=1.42..22,525.18 rows=405 width=8) (actual time=0.066..3.618 rows=387 loops=1)

20. 0.034 2.049 ↓ 1.2 313 1

Subquery Scan on "*SELECT* 1" (cost=1.42..11,266.44 rows=272 width=8) (actual time=0.065..2.049 rows=313 loops=1)

21. 0.021 2.015 ↓ 1.2 313 1

Nested Loop (cost=1.42..11,263.72 rows=272 width=8) (actual time=0.064..2.015 rows=313 loops=1)

22. 0.065 1.283 ↑ 2.7 237 1

Nested Loop (cost=0.85..2,500.89 rows=630 width=8) (actual time=0.059..1.283 rows=237 loops=1)

23. 0.708 0.708 ↑ 2.9 255 1

Index Scan using orders_idx22 on orders orders_2 (cost=0.56..1,440.42 rows=738 width=8) (actual time=0.013..0.708 rows=255 loops=1)

  • Index Cond: (end_ IS NULL)
24. 0.510 0.510 ↑ 1.0 1 255

Index Only Scan using bort_id_pk on bort bort_1 (cost=0.29..1.43 rows=1 width=4) (actual time=0.002..0.002 rows=1 loops=255)

  • Index Cond: (id = orders_2.id_bort)
  • Heap Fetches: 152
25. 0.711 0.711 ↑ 2.0 1 237

Index Scan using tochki_idx on tochki (cost=0.56..13.89 rows=2 width=4) (actual time=0.003..0.003 rows=1 loops=237)

  • Index Cond: (id_order = orders_2.id)
  • Filter: ((end_ IS NULL) AND (del_ IS NULL))
  • Rows Removed by Filter: 1
26. 0.009 1.543 ↑ 1.8 74 1

Subquery Scan on "*SELECT* 2" (cost=1.42..11,258.75 rows=133 width=8) (actual time=0.052..1.543 rows=74 loops=1)

27. 0.085 1.534 ↑ 1.8 74 1

Nested Loop (cost=1.42..11,257.42 rows=133 width=8) (actual time=0.051..1.534 rows=74 loops=1)

28. 0.159 0.975 ↑ 2.7 237 1

Nested Loop (cost=0.85..2,500.89 rows=630 width=8) (actual time=0.047..0.975 rows=237 loops=1)

29. 0.561 0.561 ↑ 2.9 255 1

Index Scan using orders_idx22 on orders orders_3 (cost=0.56..1,440.42 rows=738 width=8) (actual time=0.013..0.561 rows=255 loops=1)

  • Index Cond: (end_ IS NULL)
30. 0.255 0.255 ↑ 1.0 1 255

Index Only Scan using bort_id_pk on bort bort_2 (cost=0.29..1.43 rows=1 width=4) (actual time=0.001..0.001 rows=1 loops=255)

  • Index Cond: (id = orders_3.id_bort)
  • Heap Fetches: 152
31. 0.474 0.474 ↓ 0.0 0 237

Index Scan using tochki_idx on tochki tochki_1 (cost=0.56..13.89 rows=1 width=4) (actual time=0.002..0.002 rows=0 loops=237)

  • Index Cond: (id_order = orders_3.id)
  • Filter: ((end_ IS NULL) AND (del_ IS NULL) AND pervaya)
  • Rows Removed by Filter: 2
32. 0.002 2.983 ↑ 1.0 1 1

Subquery Scan on bort_s_klientom_1 (cost=1.42..22,530.61 rows=1 width=4) (actual time=2.983..2.983 rows=1 loops=1)

  • Filter: (orders_1.id = bort_s_klientom_1.id_order)
  • Rows Removed by Filter: 27
33. 0.066 2.981 ↑ 9.7 28 1

HashSetOp Except (cost=1.42..22,527.21 rows=272 width=8) (actual time=2.977..2.981 rows=28 loops=1)

34. 0.028 2.915 ↑ 1.0 387 1

Append (cost=1.42..22,525.18 rows=405 width=8) (actual time=0.043..2.915 rows=387 loops=1)

35. 0.039 1.508 ↓ 1.2 313 1

Subquery Scan on "*SELECT* 1_1" (cost=1.42..11,266.44 rows=272 width=8) (actual time=0.043..1.508 rows=313 loops=1)

36. 0.115 1.469 ↓ 1.2 313 1

Nested Loop (cost=1.42..11,263.72 rows=272 width=8) (actual time=0.042..1.469 rows=313 loops=1)

37. 0.136 0.880 ↑ 2.7 237 1

Nested Loop (cost=0.85..2,500.89 rows=630 width=8) (actual time=0.038..0.880 rows=237 loops=1)

38. 0.489 0.489 ↑ 2.9 255 1

Index Scan using orders_idx22 on orders orders_4 (cost=0.56..1,440.42 rows=738 width=8) (actual time=0.010..0.489 rows=255 loops=1)

  • Index Cond: (end_ IS NULL)
39. 0.255 0.255 ↑ 1.0 1 255

Index Only Scan using bort_id_pk on bort bort_3 (cost=0.29..1.43 rows=1 width=4) (actual time=0.001..0.001 rows=1 loops=255)

  • Index Cond: (id = orders_4.id_bort)
  • Heap Fetches: 152
40. 0.474 0.474 ↑ 2.0 1 237

Index Scan using tochki_idx on tochki tochki_2 (cost=0.56..13.89 rows=2 width=4) (actual time=0.002..0.002 rows=1 loops=237)

  • Index Cond: (id_order = orders_4.id)
  • Filter: ((end_ IS NULL) AND (del_ IS NULL))
  • Rows Removed by Filter: 1
41. 0.004 1.379 ↑ 1.8 74 1

Subquery Scan on "*SELECT* 2_1" (cost=1.42..11,258.75 rows=133 width=8) (actual time=0.044..1.379 rows=74 loops=1)

42. 0.074 1.375 ↑ 1.8 74 1

Nested Loop (cost=1.42..11,257.42 rows=133 width=8) (actual time=0.044..1.375 rows=74 loops=1)

43. 0.121 0.827 ↑ 2.7 237 1

Nested Loop (cost=0.85..2,500.89 rows=630 width=8) (actual time=0.039..0.827 rows=237 loops=1)

44. 0.451 0.451 ↑ 2.9 255 1

Index Scan using orders_idx22 on orders orders_5 (cost=0.56..1,440.42 rows=738 width=8) (actual time=0.010..0.451 rows=255 loops=1)

  • Index Cond: (end_ IS NULL)
45. 0.255 0.255 ↑ 1.0 1 255

Index Only Scan using bort_id_pk on bort bort_4 (cost=0.29..1.43 rows=1 width=4) (actual time=0.001..0.001 rows=1 loops=255)

  • Index Cond: (id = orders_5.id_bort)
  • Heap Fetches: 152
46. 0.474 0.474 ↓ 0.0 0 237

Index Scan using tochki_idx on tochki tochki_3 (cost=0.56..13.89 rows=1 width=4) (actual time=0.002..0.002 rows=0 loops=237)

  • Index Cond: (id_order = orders_5.id)
  • Filter: ((end_ IS NULL) AND (del_ IS NULL) AND pervaya)
  • Rows Removed by Filter: 2
47. 0.004 3.026 ↑ 1.0 1 1

Subquery Scan on bort_s_klientom_2 (cost=1.42..22,530.61 rows=1 width=4) (actual time=3.026..3.026 rows=1 loops=1)

  • Filter: (orders_1.id = bort_s_klientom_2.id_order)
  • Rows Removed by Filter: 27
48. 0.064 3.022 ↑ 9.7 28 1

HashSetOp Except (cost=1.42..22,527.21 rows=272 width=8) (actual time=3.019..3.022 rows=28 loops=1)

49. 0.032 2.958 ↑ 1.0 387 1

Append (cost=1.42..22,525.18 rows=405 width=8) (actual time=0.043..2.958 rows=387 loops=1)

50. 0.040 1.495 ↓ 1.2 313 1

Subquery Scan on "*SELECT* 1_2" (cost=1.42..11,266.44 rows=272 width=8) (actual time=0.043..1.495 rows=313 loops=1)

51. 0.094 1.455 ↓ 1.2 313 1

Nested Loop (cost=1.42..11,263.72 rows=272 width=8) (actual time=0.042..1.455 rows=313 loops=1)

52. 0.128 0.887 ↑ 2.7 237 1

Nested Loop (cost=0.85..2,500.89 rows=630 width=8) (actual time=0.038..0.887 rows=237 loops=1)

53. 0.504 0.504 ↑ 2.9 255 1

Index Scan using orders_idx22 on orders orders_6 (cost=0.56..1,440.42 rows=738 width=8) (actual time=0.009..0.504 rows=255 loops=1)

  • Index Cond: (end_ IS NULL)
54. 0.255 0.255 ↑ 1.0 1 255

Index Only Scan using bort_id_pk on bort bort_5 (cost=0.29..1.43 rows=1 width=4) (actual time=0.001..0.001 rows=1 loops=255)

  • Index Cond: (id = orders_6.id_bort)
  • Heap Fetches: 152
55. 0.474 0.474 ↑ 2.0 1 237

Index Scan using tochki_idx on tochki tochki_4 (cost=0.56..13.89 rows=2 width=4) (actual time=0.002..0.002 rows=1 loops=237)

  • Index Cond: (id_order = orders_6.id)
  • Filter: ((end_ IS NULL) AND (del_ IS NULL))
  • Rows Removed by Filter: 1
56. 0.017 1.431 ↑ 1.8 74 1

Subquery Scan on "*SELECT* 2_2" (cost=1.42..11,258.75 rows=133 width=8) (actual time=0.039..1.431 rows=74 loops=1)

57. 0.102 1.414 ↑ 1.8 74 1

Nested Loop (cost=1.42..11,257.42 rows=133 width=8) (actual time=0.039..1.414 rows=74 loops=1)

58. 0.144 0.838 ↑ 2.7 237 1

Nested Loop (cost=0.85..2,500.89 rows=630 width=8) (actual time=0.035..0.838 rows=237 loops=1)

59. 0.439 0.439 ↑ 2.9 255 1

Index Scan using orders_idx22 on orders orders_7 (cost=0.56..1,440.42 rows=738 width=8) (actual time=0.008..0.439 rows=255 loops=1)

  • Index Cond: (end_ IS NULL)
60. 0.255 0.255 ↑ 1.0 1 255

Index Only Scan using bort_id_pk on bort bort_6 (cost=0.29..1.43 rows=1 width=4) (actual time=0.001..0.001 rows=1 loops=255)

  • Index Cond: (id = orders_7.id_bort)
  • Heap Fetches: 152
61. 0.474 0.474 ↓ 0.0 0 237

Index Scan using tochki_idx on tochki tochki_5 (cost=0.56..13.89 rows=1 width=4) (actual time=0.002..0.002 rows=0 loops=237)

  • Index Cond: (id_order = orders_7.id)
  • Filter: ((end_ IS NULL) AND (del_ IS NULL) AND pervaya)
  • Rows Removed by Filter: 2
62. 0.004 2.836 ↑ 1.0 1 1

Subquery Scan on bort_s_klientom_3 (cost=1.42..22,530.61 rows=1 width=4) (actual time=2.836..2.836 rows=1 loops=1)

  • Filter: (orders_1.id = bort_s_klientom_3.id_order)
  • Rows Removed by Filter: 27
63. 0.064 2.832 ↑ 9.7 28 1

HashSetOp Except (cost=1.42..22,527.21 rows=272 width=8) (actual time=2.829..2.832 rows=28 loops=1)

64. 0.029 2.768 ↑ 1.0 387 1

Append (cost=1.42..22,525.18 rows=405 width=8) (actual time=0.053..2.768 rows=387 loops=1)

65. 0.035 1.442 ↓ 1.2 313 1

Subquery Scan on "*SELECT* 1_3" (cost=1.42..11,266.44 rows=272 width=8) (actual time=0.053..1.442 rows=313 loops=1)

66. 0.106 1.407 ↓ 1.2 313 1

Nested Loop (cost=1.42..11,263.72 rows=272 width=8) (actual time=0.052..1.407 rows=313 loops=1)

67. 0.126 0.827 ↑ 2.7 237 1

Nested Loop (cost=0.85..2,500.89 rows=630 width=8) (actual time=0.047..0.827 rows=237 loops=1)

68. 0.446 0.446 ↑ 2.9 255 1

Index Scan using orders_idx22 on orders orders_8 (cost=0.56..1,440.42 rows=738 width=8) (actual time=0.009..0.446 rows=255 loops=1)

  • Index Cond: (end_ IS NULL)
69. 0.255 0.255 ↑ 1.0 1 255

Index Only Scan using bort_id_pk on bort bort_7 (cost=0.29..1.43 rows=1 width=4) (actual time=0.001..0.001 rows=1 loops=255)

  • Index Cond: (id = orders_8.id_bort)
  • Heap Fetches: 152
70. 0.474 0.474 ↑ 2.0 1 237

Index Scan using tochki_idx on tochki tochki_6 (cost=0.56..13.89 rows=2 width=4) (actual time=0.002..0.002 rows=1 loops=237)

  • Index Cond: (id_order = orders_8.id)
  • Filter: ((end_ IS NULL) AND (del_ IS NULL))
  • Rows Removed by Filter: 1
71. 0.007 1.297 ↑ 1.8 74 1

Subquery Scan on "*SELECT* 2_3" (cost=1.42..11,258.75 rows=133 width=8) (actual time=0.043..1.297 rows=74 loops=1)

72. 0.032 1.290 ↑ 1.8 74 1

Nested Loop (cost=1.42..11,257.42 rows=133 width=8) (actual time=0.041..1.290 rows=74 loops=1)

73. 0.092 0.784 ↑ 2.7 237 1

Nested Loop (cost=0.85..2,500.89 rows=630 width=8) (actual time=0.037..0.784 rows=237 loops=1)

74. 0.437 0.437 ↑ 2.9 255 1

Index Scan using orders_idx22 on orders orders_9 (cost=0.56..1,440.42 rows=738 width=8) (actual time=0.011..0.437 rows=255 loops=1)

  • Index Cond: (end_ IS NULL)
75. 0.255 0.255 ↑ 1.0 1 255

Index Only Scan using bort_id_pk on bort bort_8 (cost=0.29..1.43 rows=1 width=4) (actual time=0.001..0.001 rows=1 loops=255)

  • Index Cond: (id = orders_9.id_bort)
  • Heap Fetches: 152
76. 0.474 0.474 ↓ 0.0 0 237

Index Scan using tochki_idx on tochki tochki_7 (cost=0.56..13.89 rows=1 width=4) (actual time=0.002..0.002 rows=0 loops=237)

  • Index Cond: (id_order = orders_9.id)
  • Filter: ((end_ IS NULL) AND (del_ IS NULL) AND pervaya)
  • Rows Removed by Filter: 2
Planning time : 9.386 ms