explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Cgo9

Settings
# exclusive inclusive rows x rows loops node
1. 0.024 11,374.882 ↓ 2.0 4 1

Nested Loop (cost=412,607.48..452,941.96 rows=2 width=920) (actual time=9,545.344..11,374.882 rows=4 loops=1)

2. 98.048 11,374.830 ↓ 2.0 4 1

Hash Right Join (cost=412,607.35..452,941.63 rows=2 width=2,037) (actual time=9,545.318..11,374.830 rows=4 loops=1)

  • Hash Cond: ((deal.deal_pair_fkey)::text = (deal_1.parent_fkey)::text)
3. 302.893 11,276.479 ↓ 1.4 711,958 1

Hash Join (cost=412,549.25..450,365.85 rows=503,531 width=949) (actual time=8,760.261..11,276.479 rows=711,958 loops=1)

  • Hash Cond: (party_buyer.party_type_fkey = party_buyer_type.id)
4. 359.142 10,973.580 ↓ 1.4 711,958 1

Hash Left Join (cost=412,548.16..447,642.54 rows=503,531 width=909) (actual time=8,760.248..10,973.580 rows=711,958 loops=1)

  • Hash Cond: (deal_details_wood_class.lu_timber_fkey = deal_details_timber_okpd.id)
5. 338.112 10,614.432 ↓ 1.4 711,958 1

Hash Left Join (cost=412,529.38..446,293.06 rows=503,531 width=911) (actual time=8,760.231..10,614.432 rows=711,958 loops=1)

  • Hash Cond: (deal_details.wood_class_fkey = deal_details_wood_class.id)
6. 230.489 10,276.198 ↓ 1.4 711,958 1

Hash Left Join (cost=412,515.43..444,933.33 rows=503,531 width=837) (actual time=8,760.102..10,276.198 rows=711,958 loops=1)

  • Hash Cond: (deal_details_tnved_class.lu_timber_fkey = deal_details_timber_tnved.id)
7. 220.994 10,045.697 ↓ 1.4 711,958 1

Hash Left Join (cost=412,496.66..443,582.53 rows=503,531 width=805) (actual time=8,760.081..10,045.697 rows=711,958 loops=1)

  • Hash Cond: (deal_details.lu_tnved_class_fkey = deal_details_tnved_class.id)
8. 959.183 9,824.495 ↓ 1.4 711,958 1

Hash Join (cost=412,475.04..442,238.54 rows=503,531 width=673) (actual time=8,759.843..9,824.495 rows=711,958 loops=1)

  • Hash Cond: ((deal_details.bo_contract_hardwood_fkey)::text = (deal.id)::text)
9. 105.602 105.602 ↓ 1.0 822,146 1

Seq Scan on bo_hardwood_deal_details deal_details (cost=0.00..21,645.23 rows=822,123 width=29) (actual time=0.004..105.602 rows=822,146 loops=1)

10. 370.038 8,759.710 ↓ 1.4 372,854 1

Hash (cost=409,213.83..409,213.83 rows=260,897 width=653) (actual time=8,759.710..8,759.710 rows=372,854 loops=1)

  • Buckets: 524288 (originally 262144) Batches: 1 (originally 1) Memory Usage: 282381kB
11. 5.988 8,389.672 ↓ 1.4 372,854 1

Gather (cost=246,146.56..409,213.83 rows=260,897 width=653) (actual time=6,236.134..8,389.672 rows=372,854 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
12. 58.958 8,383.684 ↓ 1.1 124,285 3

Hash Join (cost=245,146.56..382,124.13 rows=108,707 width=653) (actual time=6,602.426..8,383.684 rows=124,285 loops=3)

  • Hash Cond: (party_seller.party_type_fkey = party_seller_type.id)
13. 57.598 8,324.704 ↓ 1.1 124,285 3

Hash Left Join (cost=245,145.47..381,535.34 rows=108,707 width=613) (actual time=6,602.314..8,324.704 rows=124,285 loops=3)

  • Hash Cond: (buyer_subject.bo_federal_district_fkey = buyer_federal_district.id)
14. 150.345 8,267.100 ↓ 1.1 124,285 3

Hash Left Join (cost=245,144.26..381,114.40 rows=108,707 width=556) (actual time=6,602.302..8,267.100 rows=124,285 loops=3)

  • Hash Cond: ("substring"(party_buyer.inn, 1, 2) = regexp_replace((buyer_subject.id)::text, '^(\d)$'::text, '0\1'::text))
15. 160.201 8,116.641 ↓ 1.1 124,285 3

Hash Join (cost=245,141.35..379,698.30 rows=108,707 width=515) (actual time=6,602.174..8,116.641 rows=124,285 loops=3)

  • Hash Cond: ((deal.bo_party_buyer_fkey)::text = (party_buyer.id)::text)
16. 57.562 4,805.719 ↓ 1.1 124,285 3

Hash Left Join (cost=134,817.33..269,088.92 rows=108,707 width=374) (actual time=3,444.672..4,805.719 rows=124,285 loops=3)

  • Hash Cond: (seller_subject.bo_federal_district_fkey = seller_federal_district.id)
17. 189.614 4,748.136 ↓ 1.1 124,285 3

Hash Left Join (cost=134,816.12..268,667.99 rows=108,707 width=317) (actual time=3,444.644..4,748.136 rows=124,285 loops=3)

  • Hash Cond: ("substring"(party_seller.inn, 1, 2) = regexp_replace((seller_subject.id)::text, '^(\d)$'::text, '0\1'::text))
18. 125.185 4,558.282 ↓ 1.1 124,285 3

Hash Join (cost=134,813.21..267,251.89 rows=108,707 width=276) (actual time=3,444.386..4,558.282 rows=124,285 loops=3)

  • Hash Cond: ((deal.bo_party_seller_fkey)::text = (party_seller.id)::text)
19. 429.467 1,357.234 ↓ 1.1 124,285 3

Hash Join (cost=24,489.18..156,642.51 rows=108,707 width=134) (actual time=363.504..1,357.234 rows=124,285 loops=3)

  • Hash Cond: ((base.id)::text = (deal.bo_document_fkey)::text)
20. 565.809 565.809 ↑ 1.2 866,990 3

Parallel Seq Scan on bo_document_base base (cost=0.00..127,002.27 rows=1,083,727 width=45) (actual time=0.063..565.809 rows=866,990 loops=3)

  • Filter: ((contract_num <> 'HLSF-1949'::text) AND (status = 2) AND ((id)::text <> ALL ('{G_45791622,G_168914525,G_254018099,P_2655484}'::text[])))
  • Rows Removed by Filter: 548477
21. 180.610 361.958 ↑ 1.0 425,956 3

Hash (cost=19,164.71..19,164.71 rows=425,958 width=98) (actual time=361.958..361.958 rows=425,956 loops=3)

  • Buckets: 524288 Batches: 1 Memory Usage: 60584kB
22. 181.348 181.348 ↑ 1.0 425,956 3

Seq Scan on bo_contract_hardwood_deal deal (cost=0.00..19,164.71 rows=425,958 width=98) (actual time=0.030..181.348 rows=425,956 loops=3)

  • Filter: actual
  • Rows Removed by Filter: 13
23. 902.036 3,075.863 ↑ 1.0 1,951,201 3

Hash (cost=85,934.01..85,934.01 rows=1,951,201 width=160) (actual time=3,075.862..3,075.863 rows=1,951,201 loops=3)

  • Buckets: 2097152 Batches: 1 Memory Usage: 403185kB
24. 2,173.827 2,173.827 ↑ 1.0 1,951,201 3

Seq Scan on bo_party party_seller (cost=0.00..85,934.01 rows=1,951,201 width=160) (actual time=0.021..2,173.827 rows=1,951,201 loops=3)

25. 0.189 0.240 ↑ 1.0 85 3

Hash (cost=1.85..1.85 rows=85 width=41) (actual time=0.240..0.240 rows=85 loops=3)

  • Buckets: 1024 Batches: 1 Memory Usage: 15kB
26. 0.051 0.051 ↑ 1.0 85 3

Seq Scan on bo_constituent_entity seller_subject (cost=0.00..1.85 rows=85 width=41) (actual time=0.035..0.051 rows=85 loops=3)

27. 0.003 0.021 ↑ 1.0 9 3

Hash (cost=1.09..1.09 rows=9 width=59) (actual time=0.021..0.021 rows=9 loops=3)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
28. 0.018 0.018 ↑ 1.0 9 3

Seq Scan on bo_federal_district seller_federal_district (cost=0.00..1.09 rows=9 width=59) (actual time=0.017..0.018 rows=9 loops=3)

29. 960.601 3,150.721 ↑ 1.0 1,951,201 3

Hash (cost=85,934.01..85,934.01 rows=1,951,201 width=160) (actual time=3,150.721..3,150.721 rows=1,951,201 loops=3)

  • Buckets: 2097152 Batches: 1 Memory Usage: 403185kB
30. 2,190.120 2,190.120 ↑ 1.0 1,951,201 3

Seq Scan on bo_party party_buyer (cost=0.00..85,934.01 rows=1,951,201 width=160) (actual time=0.025..2,190.120 rows=1,951,201 loops=3)

31. 0.097 0.114 ↑ 1.0 85 3

Hash (cost=1.85..1.85 rows=85 width=41) (actual time=0.114..0.114 rows=85 loops=3)

  • Buckets: 1024 Batches: 1 Memory Usage: 15kB
32. 0.017 0.017 ↑ 1.0 85 3

Seq Scan on bo_constituent_entity buyer_subject (cost=0.00..1.85 rows=85 width=41) (actual time=0.004..0.017 rows=85 loops=3)

33. 0.002 0.006 ↑ 1.0 9 3

Hash (cost=1.09..1.09 rows=9 width=59) (actual time=0.006..0.006 rows=9 loops=3)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
34. 0.004 0.004 ↑ 1.0 9 3

Seq Scan on bo_federal_district buyer_federal_district (cost=0.00..1.09 rows=9 width=59) (actual time=0.003..0.004 rows=9 loops=3)

35. 0.005 0.022 ↑ 1.0 4 3

Hash (cost=1.04..1.04 rows=4 width=42) (actual time=0.022..0.022 rows=4 loops=3)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
36. 0.017 0.017 ↑ 1.0 4 3

Seq Scan on lu_party_type party_seller_type (cost=0.00..1.04 rows=4 width=42) (actual time=0.017..0.017 rows=4 loops=3)

37. 0.076 0.208 ↑ 1.0 294 1

Hash (cost=17.94..17.94 rows=294 width=134) (actual time=0.208..0.208 rows=294 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 55kB
38. 0.132 0.132 ↑ 1.0 294 1

Seq Scan on lu_tnved_class deal_details_tnved_class (cost=0.00..17.94 rows=294 width=134) (actual time=0.028..0.132 rows=294 loops=1)

39. 0.002 0.012 ↑ 195.0 2 1

Hash (cost=13.90..13.90 rows=390 width=34) (actual time=0.012..0.012 rows=2 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
40. 0.010 0.010 ↑ 195.0 2 1

Seq Scan on lu_timber deal_details_timber_tnved (cost=0.00..13.90 rows=390 width=34) (actual time=0.010..0.010 rows=2 loops=1)

41. 0.044 0.122 ↑ 1.0 220 1

Hash (cost=11.20..11.20 rows=220 width=76) (actual time=0.122..0.122 rows=220 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 31kB
42. 0.078 0.078 ↑ 1.0 220 1

Seq Scan on lu_wood_class deal_details_wood_class (cost=0.00..11.20 rows=220 width=76) (actual time=0.007..0.078 rows=220 loops=1)

43. 0.002 0.006 ↑ 195.0 2 1

Hash (cost=13.90..13.90 rows=390 width=34) (actual time=0.006..0.006 rows=2 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
44. 0.004 0.004 ↑ 195.0 2 1

Seq Scan on lu_timber deal_details_timber_okpd (cost=0.00..13.90 rows=390 width=34) (actual time=0.004..0.004 rows=2 loops=1)

45. 0.002 0.006 ↑ 1.0 4 1

Hash (cost=1.04..1.04 rows=4 width=42) (actual time=0.006..0.006 rows=4 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
46. 0.004 0.004 ↑ 1.0 4 1

Seq Scan on lu_party_type party_buyer_type (cost=0.00..1.04 rows=4 width=42) (actual time=0.004..0.004 rows=4 loops=1)

47. 0.004 0.303 ↑ 1.0 2 1

Hash (cost=58.08..58.08 rows=2 width=1,088) (actual time=0.303..0.303 rows=2 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 10kB
48. 0.003 0.299 ↑ 1.0 2 1

Nested Loop (cost=29.95..58.08 rows=2 width=1,088) (actual time=0.251..0.299 rows=2 loops=1)

49. 0.020 0.020 ↑ 1.0 1 1

Index Scan using bo_document_base_id_status_idx on bo_document_base base_1 (cost=0.43..8.46 rows=1 width=45) (actual time=0.020..0.020 rows=1 loops=1)

  • Index Cond: (((id)::text = 'P_1833869'::text) AND (status = 2))
  • Filter: (contract_num <> 'HLSF-1949'::text)
50. 0.002 0.276 ↑ 1.0 2 1

Nested Loop Left Join (cost=29.52..49.60 rows=2 width=1,052) (actual time=0.229..0.276 rows=2 loops=1)

51. 0.003 0.274 ↑ 1.0 2 1

Nested Loop Left Join (cost=29.37..48.21 rows=2 width=1,020) (actual time=0.227..0.274 rows=2 loops=1)

52. 0.002 0.271 ↑ 1.0 2 1

Nested Loop Left Join (cost=29.10..46.56 rows=2 width=888) (actual time=0.225..0.271 rows=2 loops=1)

53. 0.002 0.251 ↑ 1.0 2 1

Nested Loop (cost=28.81..43.82 rows=2 width=782) (actual time=0.212..0.251 rows=2 loops=1)

54. 0.001 0.234 ↑ 1.0 1 1

Nested Loop Left Join (cost=28.38..31.37 rows=1 width=761) (actual time=0.197..0.234 rows=1 loops=1)

55. 0.001 0.232 ↑ 1.0 1 1

Nested Loop Left Join (cost=28.25..31.04 rows=1 width=704) (actual time=0.195..0.232 rows=1 loops=1)

56. 0.068 0.226 ↑ 1.0 1 1

Hash Right Join (cost=28.11..30.72 rows=1 width=647) (actual time=0.190..0.226 rows=1 loops=1)

  • Hash Cond: (regexp_replace((buyer_subject_1.id)::text, '^(\d)$'::text, '0\1'::text) = "substring"(party_buyer_1.inn, 1, 2))
57. 0.008 0.008 ↑ 1.0 85 1

Seq Scan on bo_constituent_entity buyer_subject_1 (cost=0.00..1.85 rows=85 width=41) (actual time=0.003..0.008 rows=85 loops=1)

58. 0.002 0.150 ↑ 1.0 1 1

Hash (cost=28.10..28.10 rows=1 width=606) (actual time=0.150..0.150 rows=1 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
59. 0.001 0.148 ↑ 1.0 1 1

Nested Loop (cost=25.47..28.10 rows=1 width=606) (actual time=0.111..0.148 rows=1 loops=1)

60. 0.079 0.143 ↑ 1.0 1 1

Hash Right Join (cost=25.34..27.95 rows=1 width=566) (actual time=0.106..0.143 rows=1 loops=1)

  • Hash Cond: (regexp_replace((seller_subject_1.id)::text, '^(\d)$'::text, '0\1'::text) = "substring"(party_seller_1.inn, 1, 2))
61. 0.017 0.017 ↑ 1.0 85 1

Seq Scan on bo_constituent_entity seller_subject_1 (cost=0.00..1.85 rows=85 width=41) (actual time=0.011..0.017 rows=85 loops=1)

62. 0.004 0.047 ↑ 1.0 1 1

Hash (cost=25.33..25.33 rows=1 width=525) (actual time=0.047..0.047 rows=1 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
63. 0.001 0.043 ↑ 1.0 1 1

Nested Loop (cost=1.28..25.33 rows=1 width=525) (actual time=0.042..0.043 rows=1 loops=1)

64. 0.002 0.031 ↑ 1.0 1 1

Nested Loop (cost=0.85..16.89 rows=1 width=311) (actual time=0.030..0.031 rows=1 loops=1)

65. 0.015 0.015 ↑ 1.0 1 1

Index Scan using bo_contract_hardwood_deal__bo_document_fkey on bo_contract_hardwood_deal deal_1 (cost=0.42..8.44 rows=1 width=98) (actual time=0.014..0.015 rows=1 loops=1)

  • Index Cond: ((bo_document_fkey)::text = 'P_1833869'::text)
  • Filter: actual
66. 0.014 0.014 ↑ 1.0 1 1

Index Scan using bo_party_pkey on bo_party party_buyer_1 (cost=0.43..8.45 rows=1 width=232) (actual time=0.014..0.014 rows=1 loops=1)

  • Index Cond: ((id)::text = (deal_1.bo_party_buyer_fkey)::text)
67. 0.011 0.011 ↑ 1.0 1 1

Index Scan using bo_party_pkey on bo_party party_seller_1 (cost=0.43..8.45 rows=1 width=232) (actual time=0.011..0.011 rows=1 loops=1)

  • Index Cond: ((id)::text = (deal_1.bo_party_seller_fkey)::text)
68. 0.004 0.004 ↑ 1.0 1 1

Index Scan using lu_party_type_pkey on lu_party_type party_seller_type_1 (cost=0.13..0.15 rows=1 width=42) (actual time=0.003..0.004 rows=1 loops=1)

  • Index Cond: (id = party_seller_1.party_type_fkey)
69. 0.005 0.005 ↑ 1.0 1 1

Index Scan using bo_fed_district_pkey on bo_federal_district buyer_federal_district_1 (cost=0.14..0.29 rows=1 width=59) (actual time=0.005..0.005 rows=1 loops=1)

  • Index Cond: (id = buyer_subject_1.bo_federal_district_fkey)
70. 0.001 0.001 ↑ 1.0 1 1

Index Scan using bo_fed_district_pkey on bo_federal_district seller_federal_district_1 (cost=0.14..0.29 rows=1 width=59) (actual time=0.001..0.001 rows=1 loops=1)

  • Index Cond: (id = seller_subject_1.bo_federal_district_fkey)
71. 0.015 0.015 ↑ 1.0 2 1

Index Scan using bo_contract_hardwood_deal__bo_contract_hardwood_fkey on bo_hardwood_deal_details deal_details_1 (cost=0.42..12.44 rows=2 width=29) (actual time=0.013..0.015 rows=2 loops=1)

  • Index Cond: ((bo_contract_hardwood_fkey)::text = (deal_1.id)::text)
72. 0.004 0.018 ↑ 1.0 1 2

Nested Loop Left Join (cost=0.29..1.36 rows=1 width=108) (actual time=0.008..0.009 rows=1 loops=2)

73. 0.008 0.008 ↑ 1.0 1 2

Index Scan using lu_wood_class_pkey on lu_wood_class deal_details_wood_class_1 (cost=0.14..0.61 rows=1 width=76) (actual time=0.004..0.004 rows=1 loops=2)

  • Index Cond: (id = deal_details_1.wood_class_fkey)
74. 0.006 0.006 ↑ 1.0 1 2

Index Scan using lu_timber_pkey on lu_timber deal_details_timber_okpd_1 (cost=0.15..0.75 rows=1 width=34) (actual time=0.003..0.003 rows=1 loops=2)

  • Index Cond: (id = deal_details_wood_class_1.lu_timber_fkey)
75. 0.000 0.000 ↓ 0.0 0 2

Index Scan using lu_tnved_class_pkey on lu_tnved_class deal_details_tnved_class_1 (cost=0.27..0.82 rows=1 width=134) (actual time=0.000..0.000 rows=0 loops=2)

  • Index Cond: (id = deal_details_1.lu_tnved_class_fkey)
76. 0.000 0.000 ↓ 0.0 0 2

Index Scan using lu_timber_pkey on lu_timber deal_details_timber_tnved_1 (cost=0.15..0.70 rows=1 width=34) (actual time=0.000..0.000 rows=0 loops=2)

  • Index Cond: (id = deal_details_tnved_class_1.lu_timber_fkey)
77. 0.028 0.028 ↑ 1.0 1 4

Index Scan using lu_party_type_pkey on lu_party_type party_buyer_type_1 (cost=0.13..0.15 rows=1 width=42) (actual time=0.007..0.007 rows=1 loops=4)

  • Index Cond: (id = party_buyer_1.party_type_fkey)
Planning time : 288.290 ms
Execution time : 11,383.725 ms