explain.depesz.com

PostgreSQL's explain analyze made readable

Result: pTEV

Settings
# exclusive inclusive rows x rows loops node
1. 0.019 22,704.980 ↓ 2.0 2 1

Nested Loop (cost=624,326.30..670,714.05 rows=1 width=920) (actual time=20,811.224..22,704.980 rows=2 loops=1)

2. 0.017 22,704.957 ↓ 2.0 2 1

Nested Loop (cost=624,326.17..670,713.89 rows=1 width=2,037) (actual time=20,811.211..22,704.957 rows=2 loops=1)

3. 1.063 22,704.908 ↓ 2.0 2 1

Nested Loop Left Join (cost=624,326.04..670,713.73 rows=1 width=1,997) (actual time=20,811.192..22,704.908 rows=2 loops=1)

4. 104.350 22,703.833 ↓ 2.0 2 1

Hash Right Join (cost=624,325.89..670,711.89 rows=1 width=1,965) (actual time=20,810.129..22,703.833 rows=2 loops=1)

  • Hash Cond: ((deal.deal_pair_fkey)::text = (deal_1.parent_fkey)::text)
  • Join Filter: (COALESCE(deal_1.is_buyer, deal_details_1.is_buyer) AND ((deal_details_wood_class.id = deal_details_wood_class_1.id) OR (deal_details_tnved_class.id = deal_details_tnved_class_1.id)))
  • Rows Removed by Join Filter: 2
5. 320.479 22,598.967 ↓ 1.4 711,958 1

Hash Join (cost=624,257.67..668,755.41 rows=503,531 width=949) (actual time=19,910.794..22,598.967 rows=711,958 loops=1)

  • Hash Cond: (party_buyer.party_type_fkey = party_buyer_type.id)
6. 315.721 22,278.478 ↓ 1.4 711,958 1

Hash Join (cost=624,256.58..666,032.10 rows=503,531 width=909) (actual time=19,910.774..22,278.478 rows=711,958 loops=1)

  • Hash Cond: (party_seller.party_type_fkey = party_seller_type.id)
7. 321.631 21,962.751 ↓ 1.4 711,958 1

Hash Left Join (cost=624,255.49..663,308.79 rows=503,531 width=869) (actual time=19,910.761..21,962.751 rows=711,958 loops=1)

  • Hash Cond: (deal_details_tnved_class.lu_timber_fkey = deal_details_timber_tnved.id)
8. 260.660 21,641.115 ↓ 1.4 711,958 1

Hash Left Join (cost=624,236.71..661,957.99 rows=503,531 width=871) (actual time=19,905.140..21,641.115 rows=711,958 loops=1)

  • Hash Cond: (deal_details.lu_tnved_class_fkey = deal_details_tnved_class.id)
9. 359.353 21,380.272 ↓ 1.4 711,958 1

Hash Left Join (cost=624,215.10..660,614.01 rows=503,531 width=739) (actual time=19,904.951..21,380.272 rows=711,958 loops=1)

  • Hash Cond: (deal_details.wood_class_fkey = deal_details_wood_class.id)
10. 980.576 21,020.700 ↓ 1.4 711,958 1

Hash Join (cost=624,181.79..653,945.29 rows=503,531 width=633) (actual time=19,904.697..21,020.700 rows=711,958 loops=1)

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

12. 664.016 19,904.098 ↓ 1.4 372,854 1

Hash (cost=620,920.58..620,920.58 rows=260,897 width=613) (actual time=19,904.098..19,904.098 rows=372,854 loops=1)

  • Buckets: 524288 (originally 262144) Batches: 1 (originally 1) Memory Usage: 269393kB
13. 50.981 19,240.082 ↓ 1.4 372,854 1

Gather (cost=458,155.65..620,920.58 rows=260,897 width=613) (actual time=13,113.994..19,240.082 rows=372,854 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
14. 93.320 19,189.101 ↓ 1.1 124,285 3

Hash Left Join (cost=457,155.65..593,830.88 rows=108,707 width=613) (actual time=13,359.398..19,189.101 rows=124,285 loops=3)

  • Hash Cond: (seller_subject.bo_federal_district_fkey = seller_federal_district.id)
15. 272.701 19,095.769 ↓ 1.1 124,285 3

Hash Left Join (cost=457,154.45..593,409.94 rows=108,707 width=556) (actual time=13,359.364..19,095.769 rows=124,285 loops=3)

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

Hash Left Join (cost=457,151.53..591,993.84 rows=108,707 width=515) (actual time=13,359.047..18,822.794 rows=124,285 loops=3)

  • Hash Cond: (buyer_subject.bo_federal_district_fkey = buyer_federal_district.id)
17. 308.778 18,740.699 ↓ 1.1 124,285 3

Hash Left Join (cost=457,150.33..591,572.91 rows=108,707 width=458) (actual time=13,358.789..18,740.699 rows=124,285 loops=3)

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

Hash Join (cost=457,147.42..590,156.81 rows=108,707 width=417) (actual time=13,340.579..18,430.468 rows=124,285 loops=3)

  • Hash Cond: ((party_seller_no_golden.bo_party_golden_record_fkey)::text = (party_seller.id)::text)
19. 310.404 14,759.930 ↓ 1.1 124,285 3

Hash Join (cost=346,823.39..479,547.43 rows=108,707 width=277) (actual time=9,871.351..14,759.930 rows=124,285 loops=3)

  • Hash Cond: ((party_buyer_no_golden.bo_party_golden_record_fkey)::text = (party_buyer.id)::text)
20. 210.348 10,652.455 ↓ 1.1 124,285 3

Hash Join (cost=236,499.37..368,938.05 rows=108,707 width=137) (actual time=6,067.249..10,652.455 rows=124,285 loops=3)

  • Hash Cond: ((deal.bo_party_seller_fkey)::text = (party_seller_no_golden.id)::text)
21. 617.533 8,979.120 ↓ 1.1 124,285 3

Hash Join (cost=131,053.35..263,206.67 rows=108,707 width=135) (actual time=4,575.379..8,979.120 rows=124,285 loops=3)

  • Hash Cond: ((base.id)::text = (deal.bo_document_fkey)::text)
22. 3,796.716 3,796.716 ↑ 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.307..3,796.716 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
23. 1,008.435 4,564.871 ↑ 1.0 425,950 3

Hash (cost=125,728.87..125,728.87 rows=425,958 width=99) (actual time=4,564.871..4,564.871 rows=425,950 loops=3)

  • Buckets: 524288 Batches: 1 Memory Usage: 62207kB
24. 848.427 3,556.436 ↑ 1.0 425,950 3

Hash Join (cost=105,446.02..125,728.87 rows=425,958 width=99) (actual time=2,259.811..3,556.436 rows=425,950 loops=3)

  • Hash Cond: ((deal.bo_party_buyer_fkey)::text = (party_buyer_no_golden.id)::text)
25. 485.325 485.325 ↑ 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.032..485.325 rows=425,956 loops=3)

  • Filter: actual
  • Rows Removed by Filter: 13
26. 1,406.875 2,222.684 ↑ 1.0 1,951,201 3

Hash (cost=81,056.01..81,056.01 rows=1,951,201 width=20) (actual time=2,222.684..2,222.684 rows=1,951,201 loops=3)

  • Buckets: 2097152 Batches: 1 Memory Usage: 116872kB
27. 815.809 815.809 ↑ 1.0 1,951,201 3

Seq Scan on bo_party party_buyer_no_golden (cost=0.00..81,056.01 rows=1,951,201 width=20) (actual time=0.023..815.809 rows=1,951,201 loops=3)

28. 822.951 1,462.987 ↑ 1.0 1,951,201 3

Hash (cost=81,056.01..81,056.01 rows=1,951,201 width=20) (actual time=1,462.987..1,462.987 rows=1,951,201 loops=3)

  • Buckets: 2097152 Batches: 1 Memory Usage: 116872kB
29. 640.036 640.036 ↑ 1.0 1,951,201 3

Seq Scan on bo_party party_seller_no_golden (cost=0.00..81,056.01 rows=1,951,201 width=20) (actual time=0.018..640.036 rows=1,951,201 loops=3)

30. 1,491.373 3,797.071 ↑ 1.0 1,951,201 3

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

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

32. 1,121.441 3,461.455 ↑ 1.0 1,951,201 3

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

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

34. 1.247 1.453 ↑ 1.0 85 3

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

  • Buckets: 1024 Batches: 1 Memory Usage: 15kB
35. 0.206 0.206 ↑ 1.0 85 3

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

36. 0.004 0.086 ↑ 1.0 9 3

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

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

38. 0.237 0.274 ↑ 1.0 85 3

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

  • Buckets: 1024 Batches: 1 Memory Usage: 15kB
39. 0.037 0.037 ↑ 1.0 85 3

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

40. 0.004 0.012 ↑ 1.0 9 3

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

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

42. 0.050 0.219 ↑ 1.0 220 1

Hash (cost=30.55..30.55 rows=220 width=108) (actual time=0.219..0.219 rows=220 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 36kB
43. 0.095 0.169 ↑ 1.0 220 1

Hash Left Join (cost=18.77..30.55 rows=220 width=108) (actual time=0.053..0.169 rows=220 loops=1)

  • Hash Cond: (deal_details_wood_class.lu_timber_fkey = deal_details_timber_okpd.id)
44. 0.064 0.064 ↑ 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.036..0.064 rows=220 loops=1)

45. 0.002 0.010 ↑ 195.0 2 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
46. 0.008 0.008 ↑ 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.007..0.008 rows=2 loops=1)

47. 0.070 0.183 ↑ 1.0 294 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 55kB
48. 0.113 0.113 ↑ 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.005..0.113 rows=294 loops=1)

49. 0.001 0.005 ↑ 195.0 2 1

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

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

51. 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
52. 0.004 0.004 ↑ 1.0 4 1

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

53. 0.001 0.010 ↑ 1.0 4 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
54. 0.009 0.009 ↑ 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.008..0.009 rows=4 loops=1)

55. 0.008 0.516 ↓ 2.0 2 1

Hash (cost=68.21..68.21 rows=1 width=1,016) (actual time=0.516..0.516 rows=2 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 10kB
56. 0.005 0.508 ↓ 2.0 2 1

Nested Loop (cost=26.58..68.21 rows=1 width=1,016) (actual time=0.422..0.508 rows=2 loops=1)

57. 0.003 0.357 ↓ 2.0 2 1

Nested Loop Left Join (cost=26.14..59.74 rows=1 width=980) (actual time=0.282..0.357 rows=2 loops=1)

58. 0.003 0.350 ↓ 2.0 2 1

Nested Loop Left Join (cost=26.01..59.41 rows=1 width=923) (actual time=0.279..0.350 rows=2 loops=1)

59. 0.005 0.345 ↓ 2.0 2 1

Nested Loop Left Join (cost=25.74..55.90 rows=1 width=791) (actual time=0.277..0.345 rows=2 loops=1)

60. 0.003 0.316 ↓ 2.0 2 1

Nested Loop (cost=25.44..52.09 rows=1 width=685) (actual time=0.262..0.316 rows=2 loops=1)

61. 0.001 0.295 ↑ 1.0 1 1

Nested Loop Left Join (cost=25.02..39.64 rows=1 width=664) (actual time=0.247..0.295 rows=1 loops=1)

62. 0.007 0.289 ↑ 1.0 1 1

Hash Left Join (cost=24.88..39.32 rows=1 width=607) (actual time=0.241..0.289 rows=1 loops=1)

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

Nested Loop (cost=21.97..36.39 rows=1 width=566) (actual time=0.140..0.187 rows=1 loops=1)

64. 0.002 0.180 ↑ 1.0 1 1

Nested Loop (cost=21.54..32.17 rows=1 width=354) (actual time=0.133..0.180 rows=1 loops=1)

65. 0.091 0.164 ↑ 1.0 1 1

Hash Right Join (cost=21.12..23.72 rows=1 width=353) (actual time=0.117..0.164 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))
66. 0.019 0.019 ↑ 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.012..0.019 rows=85 loops=1)

67. 0.004 0.054 ↑ 1.0 1 1

Hash (cost=21.10..21.10 rows=1 width=312) (actual time=0.054..0.054 rows=1 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
68. 0.002 0.050 ↑ 1.0 1 1

Nested Loop (cost=1.28..21.10 rows=1 width=312) (actual time=0.048..0.050 rows=1 loops=1)

69. 0.003 0.041 ↑ 1.0 1 1

Nested Loop (cost=0.85..16.89 rows=1 width=100) (actual time=0.040..0.041 rows=1 loops=1)

70. 0.023 0.023 ↑ 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.022..0.023 rows=1 loops=1)

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

Index Scan using bo_party_pkey on bo_party party_seller_no_golden_1 (cost=0.43..8.45 rows=1 width=20) (actual time=0.015..0.015 rows=1 loops=1)

  • Index Cond: ((id)::text = (deal_1.bo_party_seller_fkey)::text)
72. 0.007 0.007 ↑ 1.0 1 1

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

  • Index Cond: ((id)::text = (party_seller_no_golden_1.bo_party_golden_record_fkey)::text)
73. 0.014 0.014 ↑ 1.0 1 1

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

  • Index Cond: ((id)::text = (deal_1.bo_party_buyer_fkey)::text)
74. 0.006 0.006 ↑ 1.0 1 1

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

  • Index Cond: ((id)::text = (party_buyer_no_golden_1.bo_party_golden_record_fkey)::text)
75. 0.077 0.095 ↑ 1.0 85 1

Hash (cost=1.85..1.85 rows=85 width=41) (actual time=0.095..0.095 rows=85 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 15kB
76. 0.018 0.018 ↑ 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.018 rows=85 loops=1)

77. 0.005 0.005 ↑ 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.005..0.005 rows=1 loops=1)

  • Index Cond: (id = seller_subject_1.bo_federal_district_fkey)
78. 0.018 0.018 ↓ 2.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=1 width=29) (actual time=0.013..0.018 rows=2 loops=1)

  • Index Cond: ((bo_contract_hardwood_fkey)::text = (deal_1.id)::text)
  • Filter: COALESCE(deal_1.is_buyer, is_buyer)
79. 0.002 0.024 ↑ 1.0 1 2

Nested Loop Left Join (cost=0.29..3.80 rows=1 width=108) (actual time=0.011..0.012 rows=1 loops=2)

80. 0.012 0.012 ↑ 1.0 1 2

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

  • Index Cond: (id = deal_details_1.wood_class_fkey)
81. 0.010 0.010 ↑ 1.0 1 2

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

  • Index Cond: (id = deal_details_wood_class_1.lu_timber_fkey)
82. 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..3.49 rows=1 width=134) (actual time=0.001..0.001 rows=0 loops=2)

  • Index Cond: (id = deal_details_1.lu_tnved_class_fkey)
83. 0.004 0.004 ↑ 1.0 1 2

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.002..0.002 rows=1 loops=2)

  • Index Cond: (id = buyer_subject_1.bo_federal_district_fkey)
84. 0.146 0.146 ↑ 1.0 1 2

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.073..0.073 rows=1 loops=2)

  • Index Cond: (((id)::text = 'P_1833869'::text) AND (status = 2))
  • Filter: (contract_num <> 'HLSF-1949'::text)
85. 0.012 0.012 ↓ 0.0 0 2

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

  • Index Cond: (id = deal_details_tnved_class_1.lu_timber_fkey)
86. 0.032 0.032 ↑ 1.0 1 2

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.016..0.016 rows=1 loops=2)

  • Index Cond: (id = party_seller_1.party_type_fkey)
87. 0.004 0.004 ↑ 1.0 1 2

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.002..0.002 rows=1 loops=2)

  • Index Cond: (id = party_buyer_1.party_type_fkey)
Planning time : 319.722 ms
Execution time : 23,043.848 ms