explain.depesz.com

PostgreSQL's explain analyze made readable

Result: BGSH

Settings
# exclusive inclusive rows x rows loops node
1. 94.699 11,507.803 ↓ 2.0 4 1

Hash Right Join (cost=412,357.14..449,361.52 rows=2 width=920) (actual time=9,984.919..11,507.803 rows=4 loops=1)

  • Hash Cond: ((deal.deal_pair_fkey)::text = (deal_1.parent_fkey)::text)
2. 354.051 11,412.791 ↓ 1.4 711,958 1

Hash Left Join (cost=412,298.91..446,785.59 rows=503,531 width=949) (actual time=9,318.146..11,412.791 rows=711,958 loops=1)

  • Hash Cond: (deal_details_wood_class.lu_timber_fkey = deal_details_timber_okpd.id)
3. 336.796 11,058.734 ↓ 1.4 711,958 1

Hash Left Join (cost=412,280.13..445,436.10 rows=503,531 width=951) (actual time=9,318.132..11,058.734 rows=711,958 loops=1)

  • Hash Cond: (deal_details.wood_class_fkey = deal_details_wood_class.id)
4. 233.210 10,721.820 ↓ 1.4 711,958 1

Hash Left Join (cost=412,266.18..444,076.37 rows=503,531 width=877) (actual time=9,318.006..10,721.820 rows=711,958 loops=1)

  • Hash Cond: (deal_details.lu_tnved_class_fkey = deal_details_tnved_class.id)
5. 1,061.802 10,488.305 ↓ 1.4 711,958 1

Hash Join (cost=412,225.01..441,988.51 rows=503,531 width=713) (actual time=9,317.678..10,488.305 rows=711,958 loops=1)

  • Hash Cond: ((deal_details.bo_contract_hardwood_fkey)::text = (deal.id)::text)
6. 108.960 108.960 ↓ 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.006..108.960 rows=822,146 loops=1)

7. 547.874 9,317.543 ↓ 1.4 372,854 1

Hash (cost=408,963.80..408,963.80 rows=260,897 width=693) (actual time=9,317.542..9,317.543 rows=372,854 loops=1)

  • Buckets: 524288 (originally 262144) Batches: 1 (originally 1) Memory Usage: 295696kB
8. 0.000 8,769.669 ↓ 1.4 372,854 1

Gather (cost=246,148.29..408,963.80 rows=260,897 width=693) (actual time=6,605.141..8,769.669 rows=372,854 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
9. 63.972 8,815.064 ↓ 1.1 124,285 3

Hash Join (cost=245,148.29..381,874.10 rows=108,707 width=693) (actual time=6,891.658..8,815.064 rows=124,285 loops=3)

  • Hash Cond: (party_buyer.party_type_fkey = party_buyer_type.id)
10. 63.880 8,751.068 ↓ 1.1 124,285 3

Hash Join (cost=245,147.20..381,285.31 rows=108,707 width=653) (actual time=6,891.539..8,751.068 rows=124,285 loops=3)

  • Hash Cond: (party_seller.party_type_fkey = party_seller_type.id)
11. 208.154 8,687.184 ↓ 1.1 124,285 3

Hash Left Join (cost=245,146.11..380,696.52 rows=108,707 width=613) (actual time=6,891.525..8,687.184 rows=124,285 loops=3)

  • Hash Cond: ("substring"(party_seller.inn, 1, 2) = regexp_replace((seller_subject.id)::text, '^(\d)$'::text, '0\1'::text))
12. 153.282 8,478.859 ↓ 1.1 124,285 3

Hash Join (cost=245,141.67..379,278.89 rows=108,707 width=515) (actual time=6,891.345..8,478.859 rows=124,285 loops=3)

  • Hash Cond: ((deal.bo_party_seller_fkey)::text = (party_seller.id)::text)
13. 202.810 4,994.677 ↓ 1.1 124,285 3

Hash Left Join (cost=134,817.65..268,669.51 rows=108,707 width=373) (actual time=3,554.187..4,994.677 rows=124,285 loops=3)

  • Hash Cond: ("substring"(party_buyer.inn, 1, 2) = regexp_replace((buyer_subject.id)::text, '^(\d)$'::text, '0\1'::text))
14. 161.586 4,791.548 ↓ 1.1 124,285 3

Hash Join (cost=134,813.21..267,251.89 rows=108,707 width=275) (actual time=3,553.850..4,791.548 rows=124,285 loops=3)

  • Hash Cond: ((deal.bo_party_buyer_fkey)::text = (party_buyer.id)::text)
15. 463.627 1,465.404 ↓ 1.1 124,285 3

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

  • Hash Cond: ((base.id)::text = (deal.bo_document_fkey)::text)
16. 619.039 619.039 ↑ 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.064..619.039 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
17. 194.775 382.738 ↑ 1.0 425,956 3

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

  • Buckets: 524288 Batches: 1 Memory Usage: 60584kB
18. 187.963 187.963 ↑ 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.024..187.963 rows=425,956 loops=3)

  • Filter: actual
  • Rows Removed by Filter: 13
19. 940.557 3,164.558 ↑ 1.0 1,951,201 3

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

  • Buckets: 2097152 Batches: 1 Memory Usage: 403185kB
20. 2,224.001 2,224.001 ↑ 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.022..2,224.001 rows=1,951,201 loops=3)

21. 0.218 0.319 ↑ 1.0 85 3

Hash (cost=3.38..3.38 rows=85 width=98) (actual time=0.319..0.319 rows=85 loops=3)

  • Buckets: 1024 Batches: 1 Memory Usage: 19kB
22. 0.043 0.101 ↑ 1.0 85 3

Hash Left Join (cost=1.20..3.38 rows=85 width=98) (actual time=0.062..0.101 rows=85 loops=3)

  • Hash Cond: (buyer_subject.bo_federal_district_fkey = buyer_federal_district.id)
23. 0.040 0.040 ↑ 1.0 85 3

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

24. 0.004 0.018 ↑ 1.0 9 3

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

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
25. 0.014 0.014 ↑ 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.012..0.014 rows=9 loops=3)

26. 1,040.220 3,330.900 ↑ 1.0 1,951,201 3

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

  • Buckets: 2097152 Batches: 1 Memory Usage: 403185kB
27. 2,290.680 2,290.680 ↑ 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.026..2,290.680 rows=1,951,201 loops=3)

28. 0.114 0.171 ↑ 1.0 85 3

Hash (cost=3.38..3.38 rows=85 width=98) (actual time=0.171..0.171 rows=85 loops=3)

  • Buckets: 1024 Batches: 1 Memory Usage: 19kB
29. 0.037 0.057 ↑ 1.0 85 3

Hash Left Join (cost=1.20..3.38 rows=85 width=98) (actual time=0.020..0.057 rows=85 loops=3)

  • Hash Cond: (seller_subject.bo_federal_district_fkey = seller_federal_district.id)
30. 0.012 0.012 ↑ 1.0 85 3

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

31. 0.004 0.008 ↑ 1.0 9 3

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

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
32. 0.004 0.004 ↑ 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.002..0.004 rows=9 loops=3)

33. 0.002 0.004 ↑ 1.0 4 3

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

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
34. 0.002 0.002 ↑ 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.002..0.002 rows=4 loops=3)

35. 0.005 0.024 ↑ 1.0 4 3

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

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

Seq Scan on lu_party_type party_buyer_type (cost=0.00..1.04 rows=4 width=42) (actual time=0.018..0.019 rows=4 loops=3)

37. 0.086 0.305 ↑ 1.0 294 1

Hash (cost=37.50..37.50 rows=294 width=166) (actual time=0.305..0.305 rows=294 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 63kB
38. 0.144 0.219 ↑ 1.0 294 1

Hash Left Join (cost=18.77..37.50 rows=294 width=166) (actual time=0.036..0.219 rows=294 loops=1)

  • Hash Cond: (deal_details_tnved_class.lu_timber_fkey = deal_details_timber_tnved.id)
39. 0.063 0.063 ↑ 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.018..0.063 rows=294 loops=1)

40. 0.003 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
41. 0.009 0.009 ↑ 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.008..0.009 rows=2 loops=1)

42. 0.045 0.118 ↑ 1.0 220 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 31kB
43. 0.073 0.073 ↑ 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.073 rows=220 loops=1)

44. 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
45. 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)

46. 0.005 0.313 ↑ 1.0 2 1

Hash (cost=58.21..58.21 rows=2 width=1,128) (actual time=0.313..0.313 rows=2 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 10kB
47. 0.003 0.308 ↑ 1.0 2 1

Nested Loop Left Join (cost=30.06..58.21 rows=2 width=1,128) (actual time=0.258..0.308 rows=2 loops=1)

48. 0.001 0.305 ↑ 1.0 2 1

Nested Loop Left Join (cost=29.91..56.81 rows=2 width=1,096) (actual time=0.256..0.305 rows=2 loops=1)

49. 0.001 0.302 ↑ 1.0 2 1

Nested Loop Left Join (cost=29.64..55.16 rows=2 width=964) (actual time=0.254..0.302 rows=2 loops=1)

50. 0.002 0.293 ↑ 1.0 2 1

Nested Loop Left Join (cost=29.49..53.67 rows=2 width=932) (actual time=0.247..0.293 rows=2 loops=1)

51. 0.002 0.283 ↑ 1.0 2 1

Nested Loop (cost=29.35..52.45 rows=2 width=858) (actual time=0.241..0.283 rows=2 loops=1)

52. 0.002 0.266 ↑ 1.0 1 1

Nested Loop (cost=28.92..39.99 rows=1 width=837) (actual time=0.227..0.266 rows=1 loops=1)

53. 0.001 0.263 ↑ 1.0 1 1

Nested Loop (cost=28.79..39.84 rows=1 width=797) (actual time=0.225..0.263 rows=1 loops=1)

54. 0.001 0.258 ↑ 1.0 1 1

Nested Loop Left Join (cost=28.66..39.68 rows=1 width=757) (actual time=0.220..0.258 rows=1 loops=1)

55. 0.001 0.256 ↑ 1.0 1 1

Nested Loop Left Join (cost=28.53..39.36 rows=1 width=700) (actual time=0.218..0.256 rows=1 loops=1)

56. 0.001 0.251 ↑ 1.0 1 1

Nested Loop (cost=28.39..39.03 rows=1 width=643) (actual time=0.213..0.251 rows=1 loops=1)

57. 0.071 0.235 ↑ 1.0 1 1

Hash Right Join (cost=27.96..30.56 rows=1 width=607) (actual time=0.197..0.235 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))
58. 0.009 0.009 ↑ 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.009 rows=85 loops=1)

59. 0.002 0.155 ↑ 1.0 1 1

Hash (cost=27.95..27.95 rows=1 width=566) (actual time=0.155..0.155 rows=1 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
60. 0.002 0.153 ↑ 1.0 1 1

Nested Loop (cost=17.33..27.95 rows=1 width=566) (actual time=0.116..0.153 rows=1 loops=1)

61. 0.080 0.139 ↑ 1.0 1 1

Hash Right Join (cost=16.90..19.50 rows=1 width=353) (actual time=0.102..0.139 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))
62. 0.018 0.018 ↑ 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.013..0.018 rows=85 loops=1)

63. 0.004 0.041 ↑ 1.0 1 1

Hash (cost=16.89..16.89 rows=1 width=312) (actual time=0.041..0.041 rows=1 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
64. 0.003 0.037 ↑ 1.0 1 1

Nested Loop (cost=0.85..16.89 rows=1 width=312) (actual time=0.036..0.037 rows=1 loops=1)

65. 0.021 0.021 ↑ 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.020..0.021 rows=1 loops=1)

  • Index Cond: ((bo_document_fkey)::text = 'P_1833869'::text)
  • Filter: actual
66. 0.013 0.013 ↑ 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.013..0.013 rows=1 loops=1)

  • Index Cond: ((id)::text = (deal_1.bo_party_seller_fkey)::text)
67. 0.012 0.012 ↑ 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.012..0.012 rows=1 loops=1)

  • Index Cond: ((id)::text = (deal_1.bo_party_buyer_fkey)::text)
68. 0.015 0.015 ↑ 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.014..0.015 rows=1 loops=1)

  • Index Cond: (((id)::text = 'P_1833869'::text) AND (status = 2))
  • Filter: (contract_num <> 'HLSF-1949'::text)
69. 0.004 0.004 ↑ 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.004..0.004 rows=1 loops=1)

  • Index Cond: (id = seller_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 buyer_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 = buyer_subject_1.bo_federal_district_fkey)
71. 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.004..0.004 rows=1 loops=1)

  • Index Cond: (id = party_seller_1.party_type_fkey)
72. 0.001 0.001 ↑ 1.0 1 1

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.001..0.001 rows=1 loops=1)

  • Index Cond: (id = party_buyer_1.party_type_fkey)
73. 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.012..0.015 rows=2 loops=1)

  • Index Cond: ((bo_contract_hardwood_fkey)::text = (deal_1.id)::text)
74. 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)
75. 0.008 0.008 ↑ 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.004..0.004 rows=1 loops=2)

  • Index Cond: (id = deal_details_wood_class_1.lu_timber_fkey)
76. 0.002 0.002 ↓ 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.001..0.001 rows=0 loops=2)

  • Index Cond: (id = deal_details_1.lu_tnved_class_fkey)
77. 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)
Planning time : 772.847 ms
Execution time : 11,550.126 ms