explain.depesz.com

PostgreSQL's explain analyze made readable

Result: eDnp

Settings
# exclusive inclusive rows x rows loops node
1. 0.021 14,537.403 ↓ 2.0 2 1

Nested Loop (cost=623,484.18..669,870.21 rows=1 width=920) (actual time=12,746.034..14,537.403 rows=2 loops=1)

2. 94.161 14,537.358 ↓ 2.0 2 1

Hash Right Join (cost=623,484.05..669,870.05 rows=1 width=2,037) (actual time=12,746.009..14,537.358 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
3. 293.682 14,442.703 ↓ 1.4 711,958 1

Hash Join (cost=623,424.88..667,922.62 rows=503,531 width=949) (actual time=11,978.965..14,442.703 rows=711,958 loops=1)

  • Hash Cond: (party_buyer.party_type_fkey = party_buyer_type.id)
4. 284.863 14,149.015 ↓ 1.4 711,958 1

Hash Join (cost=623,423.79..665,199.32 rows=503,531 width=909) (actual time=11,978.949..14,149.015 rows=711,958 loops=1)

  • Hash Cond: (party_seller.party_type_fkey = party_seller_type.id)
5. 288.042 13,864.148 ↓ 1.4 711,958 1

Hash Left Join (cost=623,422.70..662,476.01 rows=503,531 width=869) (actual time=11,978.938..13,864.148 rows=711,958 loops=1)

  • Hash Cond: (deal_details_tnved_class.lu_timber_fkey = deal_details_timber_tnved.id)
6. 245.918 13,576.099 ↓ 1.4 711,958 1

Hash Left Join (cost=623,403.93..661,125.21 rows=503,531 width=871) (actual time=11,978.922..13,576.099 rows=711,958 loops=1)

  • Hash Cond: (deal_details.lu_tnved_class_fkey = deal_details_tnved_class.id)
7. 327.302 13,329.993 ↓ 1.4 711,958 1

Hash Left Join (cost=623,382.31..659,781.22 rows=503,531 width=739) (actual time=11,978.725..13,329.993 rows=711,958 loops=1)

  • Hash Cond: (deal_details.wood_class_fkey = deal_details_wood_class.id)
8. 919.777 13,002.415 ↓ 1.4 711,958 1

Hash Join (cost=623,349.01..653,112.51 rows=503,531 width=633) (actual time=11,978.417..13,002.415 rows=711,958 loops=1)

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

10. 494.971 11,978.233 ↓ 1.4 372,854 1

Hash (cost=620,087.80..620,087.80 rows=260,897 width=613) (actual time=11,978.233..11,978.233 rows=372,854 loops=1)

  • Buckets: 524288 (originally 262144) Batches: 1 (originally 1) Memory Usage: 268642kB
11. 0.000 11,483.262 ↓ 1.4 372,854 1

Gather (cost=457,037.51..620,087.80 rows=260,897 width=613) (actual time=8,853.937..11,483.262 rows=372,854 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
12. 73.490 11,511.906 ↓ 1.1 124,285 3

Hash Left Join (cost=456,037.51..592,998.10 rows=108,707 width=613) (actual time=9,237.085..11,511.906 rows=124,285 loops=3)

  • Hash Cond: (buyer_subject.bo_federal_district_fkey = buyer_federal_district.id)
13. 175.704 11,438.407 ↓ 1.1 124,285 3

Hash Left Join (cost=456,036.31..592,577.16 rows=108,707 width=556) (actual time=9,237.068..11,438.407 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. 70.304 11,262.581 ↓ 1.1 124,285 3

Hash Left Join (cost=456,033.40..591,161.06 rows=108,707 width=515) (actual time=9,236.935..11,262.581 rows=124,285 loops=3)

  • Hash Cond: (seller_subject.bo_federal_district_fkey = seller_federal_district.id)
15. 251.405 11,192.257 ↓ 1.1 124,285 3

Hash Left Join (cost=456,032.19..590,740.12 rows=108,707 width=458) (actual time=9,236.870..11,192.257 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. 174.990 10,940.637 ↓ 1.1 124,285 3

Hash Join (cost=456,029.28..589,324.02 rows=108,707 width=417) (actual time=9,236.636..10,940.637 rows=124,285 loops=3)

  • Hash Cond: ((party_buyer_no_golden.bo_party_golden_record_fkey)::text = (party_buyer.id)::text)
17. 143.279 7,608.482 ↓ 1.1 124,285 3

Hash Join (cost=345,705.26..478,714.64 rows=108,707 width=277) (actual time=6,068.858..7,608.482 rows=124,285 loops=3)

  • Hash Cond: ((deal.bo_party_buyer_fkey)::text = (party_buyer_no_golden.id)::text)
18. 139.306 6,324.269 ↓ 1.1 124,285 3

Hash Join (cost=240,259.23..372,983.27 rows=108,707 width=276) (actual time=4,921.717..6,324.269 rows=124,285 loops=3)

  • Hash Cond: ((party_seller_no_golden.bo_party_golden_record_fkey)::text = (party_seller.id)::text)
19. 119.767 2,908.561 ↓ 1.1 124,285 3

Hash Join (cost=129,935.21..262,373.88 rows=108,707 width=136) (actual time=1,638.924..2,908.561 rows=124,285 loops=3)

  • Hash Cond: ((deal.bo_party_seller_fkey)::text = (party_seller_no_golden.id)::text)
20. 494.591 1,537.841 ↓ 1.1 124,285 3

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

  • Hash Cond: ((base.id)::text = (deal.bo_document_fkey)::text)
21. 663.211 663.211 ↑ 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.055..663.211 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
22. 190.870 380.039 ↑ 1.0 425,956 3

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

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

  • Filter: actual
  • Rows Removed by Filter: 13
24. 622.043 1,250.953 ↑ 1.0 1,951,201 3

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

  • Buckets: 2097152 Batches: 1 Memory Usage: 116872kB
25. 628.910 628.910 ↑ 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.020..628.910 rows=1,951,201 loops=3)

26. 993.993 3,276.402 ↑ 1.0 1,951,201 3

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

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

28. 576.462 1,140.934 ↑ 1.0 1,951,201 3

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

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

30. 968.022 3,157.165 ↑ 1.0 1,951,201 3

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

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

32. 0.162 0.215 ↑ 1.0 85 3

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

  • Buckets: 1024 Batches: 1 Memory Usage: 15kB
33. 0.053 0.053 ↑ 1.0 85 3

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

34. 0.003 0.020 ↑ 1.0 9 3

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

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

36. 0.102 0.122 ↑ 1.0 85 3

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

  • Buckets: 1024 Batches: 1 Memory Usage: 15kB
37. 0.020 0.020 ↑ 1.0 85 3

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

38. 0.005 0.009 ↑ 1.0 9 3

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

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
39. 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)

40. 0.067 0.276 ↑ 1.0 220 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 36kB
41. 0.123 0.209 ↑ 1.0 220 1

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

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

43. 0.005 0.021 ↑ 195.0 2 1

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

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

45. 0.073 0.188 ↑ 1.0 294 1

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

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

47. 0.002 0.007 ↑ 195.0 2 1

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

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

49. 0.002 0.004 ↑ 1.0 4 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
50. 0.002 0.002 ↑ 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.002..0.002 rows=4 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_buyer_type (cost=0.00..1.04 rows=4 width=42) (actual time=0.003..0.004 rows=4 loops=1)

53. 0.006 0.494 ↓ 2.0 2 1

Hash (cost=59.15..59.15 rows=1 width=1,088) (actual time=0.494..0.494 rows=2 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 10kB
54. 0.004 0.488 ↓ 2.0 2 1

Nested Loop (cost=29.95..59.15 rows=1 width=1,088) (actual time=0.423..0.488 rows=2 loops=1)

55. 0.002 0.458 ↓ 2.0 2 1

Nested Loop Left Join (cost=29.52..50.68 rows=1 width=1,052) (actual time=0.403..0.458 rows=2 loops=1)

56. 0.003 0.454 ↓ 2.0 2 1

Nested Loop Left Join (cost=29.10..46.80 rows=1 width=888) (actual time=0.401..0.454 rows=2 loops=1)

57. 0.002 0.433 ↓ 2.0 2 1

Nested Loop (cost=28.81..43.81 rows=1 width=782) (actual time=0.386..0.433 rows=2 loops=1)

58. 0.002 0.413 ↑ 1.0 1 1

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

59. 0.002 0.410 ↑ 1.0 1 1

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

60. 0.094 0.404 ↑ 1.0 1 1

Hash Right Join (cost=28.11..30.72 rows=1 width=647) (actual time=0.361..0.404 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))
61. 0.014 0.014 ↑ 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.007..0.014 rows=85 loops=1)

62. 0.003 0.296 ↑ 1.0 1 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
63. 0.002 0.293 ↑ 1.0 1 1

Nested Loop (cost=17.46..28.10 rows=1 width=606) (actual time=0.250..0.293 rows=1 loops=1)

64. 0.003 0.275 ↑ 1.0 1 1

Nested Loop (cost=17.03..19.66 rows=1 width=393) (actual time=0.232..0.275 rows=1 loops=1)

65. 0.171 0.263 ↑ 1.0 1 1

Hash Right Join (cost=16.90..19.50 rows=1 width=353) (actual time=0.221..0.263 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.040 0.040 ↑ 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.031..0.040 rows=85 loops=1)

67. 0.004 0.052 ↑ 1.0 1 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
68. 0.004 0.048 ↑ 1.0 1 1

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

69. 0.029 0.029 ↑ 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.028..0.029 rows=1 loops=1)

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

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

  • Index Cond: (id = party_seller_1.party_type_fkey)
72. 0.016 0.016 ↑ 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.016..0.016 rows=1 loops=1)

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

  • Index Cond: (id = buyer_subject_1.bo_federal_district_fkey)
74. 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)
75. 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.015..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)
76. 0.004 0.018 ↑ 1.0 1 2

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

77. 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..1.50 rows=1 width=76) (actual time=0.004..0.004 rows=1 loops=2)

  • Index Cond: (id = deal_details_1.wood_class_fkey)
78. 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..1.47 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)
79. 0.002 0.002 ↓ 0.0 0 2

Nested Loop Left Join (cost=0.42..3.87 rows=1 width=166) (actual time=0.001..0.001 rows=0 loops=2)

80. 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..2.42 rows=1 width=134) (actual time=0.000..0.000 rows=0 loops=2)

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

Index Scan using lu_timber_pkey on lu_timber deal_details_timber_tnved_1 (cost=0.15..1.44 rows=1 width=34) (never executed)

  • Index Cond: (id = deal_details_tnved_class_1.lu_timber_fkey)
82. 0.026 0.026 ↑ 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.013..0.013 rows=1 loops=2)

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

  • Index Cond: (id = party_buyer_1.party_type_fkey)
Planning time : 333.878 ms
Execution time : 14,603.251 ms