explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 7prZ

Settings
# exclusive inclusive rows x rows loops node
1. 84.246 11,281.871 ↓ 2.0 4 1

Hash Right Join (cost=412,352.24..449,356.62 rows=2 width=920) (actual time=9,848.781..11,281.871 rows=4 loops=1)

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

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

  • Hash Cond: (deal_details_wood_class.lu_timber_fkey = deal_details_timber_okpd.id)
3. 328.782 10,839.810 ↓ 1.4 711,958 1

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

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

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

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

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

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

7. 508.085 9,220.746 ↓ 1.4 372,854 1

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

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

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

  • Workers Planned: 2
  • Workers Launched: 2
9. 59.628 8,774.191 ↓ 1.1 124,285 3

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

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

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

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

Hash Left Join (cost=245,146.11..380,696.52 rows=108,707 width=613) (actual time=6,959.738..8,655.392 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. 144.745 8,467.086 ↓ 1.1 124,285 3

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

  • Hash Cond: ((deal.bo_party_seller_fkey)::text = (party_seller.id)::text)
13. 185.375 5,056.760 ↓ 1.1 124,285 3

Hash Left Join (cost=134,817.65..268,669.51 rows=108,707 width=373) (actual time=3,686.594..5,056.760 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. 156.618 4,871.096 ↓ 1.1 124,285 3

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

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

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

  • Hash Cond: ((base.id)::text = (deal.bo_document_fkey)::text)
16. 598.163 598.163 ↑ 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.290..598.163 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. 187.856 365.539 ↑ 1.0 425,956 3

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

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

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

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

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

21. 0.179 0.289 ↑ 1.0 85 3

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

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

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

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

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

24. 0.005 0.019 ↑ 1.0 9 3

Hash (cost=1.09..1.09 rows=9 width=59) (actual time=0.019..0.019 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,024.216 3,265.581 ↑ 1.0 1,951,201 3

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

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

28. 0.110 0.162 ↑ 1.0 85 3

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

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

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

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

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

31. 0.003 0.007 ↑ 1.0 9 3

Hash (cost=1.09..1.09 rows=9 width=59) (actual time=0.007..0.007 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.003 0.007 ↑ 1.0 4 3

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

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

35. 0.006 0.030 ↑ 1.0 4 3

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

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

37. 0.084 0.302 ↑ 1.0 294 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 63kB
38. 0.140 0.218 ↑ 1.0 294 1

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

  • Hash Cond: (deal_details_tnved_class.lu_timber_fkey = deal_details_timber_tnved.id)
39. 0.066 0.066 ↑ 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.021..0.066 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.007..0.009 rows=2 loops=1)

42. 0.046 0.120 ↑ 1.0 220 1

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

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

46. 0.012 2.538 ↑ 1.0 2 1

Hash (cost=53.31..53.31 rows=2 width=1,128) (actual time=2.537..2.538 rows=2 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 10kB
47. 0.004 2.526 ↑ 1.0 2 1

Nested Loop Left Join (cost=3.68..53.31 rows=2 width=1,128) (actual time=2.500..2.526 rows=2 loops=1)

48. 0.005 2.520 ↑ 1.0 2 1

Nested Loop Left Join (cost=3.53..51.92 rows=2 width=1,096) (actual time=2.495..2.520 rows=2 loops=1)

49. 0.005 2.513 ↑ 1.0 2 1

Nested Loop Left Join (cost=3.26..50.27 rows=2 width=964) (actual time=2.490..2.513 rows=2 loops=1)

50. 0.006 2.488 ↑ 1.0 2 1

Nested Loop Left Join (cost=3.11..48.77 rows=2 width=932) (actual time=2.468..2.488 rows=2 loops=1)

51. 0.005 2.472 ↑ 1.0 2 1

Nested Loop (cost=2.96..47.55 rows=2 width=858) (actual time=2.458..2.472 rows=2 loops=1)

52. 0.002 2.448 ↑ 1.0 1 1

Nested Loop (cost=2.54..35.10 rows=1 width=837) (actual time=2.440..2.448 rows=1 loops=1)

53. 0.003 2.444 ↑ 1.0 1 1

Nested Loop (cost=2.41..34.94 rows=1 width=797) (actual time=2.436..2.444 rows=1 loops=1)

54. 0.002 2.436 ↑ 1.0 1 1

Nested Loop Left Join (cost=2.28..34.79 rows=1 width=757) (actual time=2.428..2.436 rows=1 loops=1)

55. 0.006 2.432 ↑ 1.0 1 1

Nested Loop Left Join (cost=2.15..34.46 rows=1 width=700) (actual time=2.424..2.432 rows=1 loops=1)

56. 0.005 2.422 ↑ 1.0 1 1

Nested Loop (cost=1.99..34.29 rows=1 width=659) (actual time=2.414..2.422 rows=1 loops=1)

57. 0.006 2.397 ↑ 1.0 1 1

Nested Loop Left Join (cost=1.57..25.85 rows=1 width=446) (actual time=2.390..2.397 rows=1 loops=1)

58. 0.008 2.382 ↑ 1.0 1 1

Nested Loop Left Join (cost=1.43..25.52 rows=1 width=389) (actual time=2.375..2.382 rows=1 loops=1)

59. 0.003 0.066 ↑ 1.0 1 1

Nested Loop (cost=1.28..25.36 rows=1 width=348) (actual time=0.060..0.066 rows=1 loops=1)

60. 0.003 0.049 ↑ 1.0 1 1

Nested Loop (cost=0.85..16.91 rows=1 width=134) (actual time=0.043..0.049 rows=1 loops=1)

61. 0.028 0.028 ↑ 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.025..0.028 rows=1 loops=1)

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

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

  • Index Cond: ((id)::text = (deal_1.bo_party_seller_fkey)::text)
64. 2.308 2.308 ↑ 1.0 1 1

Index Scan using bo_const_entity_pkey on bo_constituent_entity seller_subject_1 (cost=0.15..0.17 rows=1 width=41) (actual time=2.308..2.308 rows=1 loops=1)

  • Index Cond: (id = ("substring"(party_seller_1.inn, 1, 2))::integer)
65. 0.009 0.009 ↑ 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.009..0.009 rows=1 loops=1)

  • Index Cond: (id = seller_subject_1.bo_federal_district_fkey)
66. 0.020 0.020 ↑ 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.020..0.020 rows=1 loops=1)

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

Index Scan using bo_const_entity_pkey on bo_constituent_entity buyer_subject_1 (cost=0.15..0.17 rows=1 width=41) (actual time=0.004..0.004 rows=1 loops=1)

  • Index Cond: (id = ("substring"(party_buyer_1.inn, 1, 2))::integer)
68. 0.002 0.002 ↑ 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.002..0.002 rows=1 loops=1)

  • Index Cond: (id = buyer_subject_1.bo_federal_district_fkey)
69. 0.005 0.005 ↑ 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.005..0.005 rows=1 loops=1)

  • Index Cond: (id = party_seller_1.party_type_fkey)
70. 0.002 0.002 ↑ 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.002..0.002 rows=1 loops=1)

  • Index Cond: (id = party_buyer_1.party_type_fkey)
71. 0.019 0.019 ↑ 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.015..0.019 rows=2 loops=1)

  • Index Cond: ((bo_contract_hardwood_fkey)::text = (deal_1.id)::text)
72. 0.010 0.010 ↑ 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.005..0.005 rows=1 loops=2)

  • Index Cond: (id = deal_details_1.wood_class_fkey)
73. 0.020 0.020 ↑ 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.010..0.010 rows=1 loops=2)

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

  • Index Cond: (id = deal_details_tnved_class_1.lu_timber_fkey)
Planning time : 779.272 ms
Execution time : 11,323.330 ms