explain.depesz.com

PostgreSQL's explain analyze made readable

Result: xuaD

Settings
# exclusive inclusive rows x rows loops node
1. 0.021 24,951.443 ↓ 2.0 2 1

Nested Loop (cost=623,484.18..669,870.21 rows=1 width=920) (actual time=23,186.108..24,951.443 rows=2 loops=1)

2. 92.367 24,951.398 ↓ 2.0 2 1

Hash Right Join (cost=623,484.05..669,870.05 rows=1 width=2,037) (actual time=23,186.083..24,951.398 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. 296.980 24,840.555 ↓ 1.4 711,958 1

Hash Join (cost=623,424.88..667,922.62 rows=503,531 width=949) (actual time=22,400.535..24,840.555 rows=711,958 loops=1)

  • Hash Cond: (party_buyer.party_type_fkey = party_buyer_type.id)
4. 284.898 24,543.536 ↓ 1.4 711,958 1

Hash Join (cost=623,423.79..665,199.32 rows=503,531 width=909) (actual time=22,399.828..24,543.536 rows=711,958 loops=1)

  • Hash Cond: (party_seller.party_type_fkey = party_seller_type.id)
5. 281.089 24,258.631 ↓ 1.4 711,958 1

Hash Left Join (cost=623,422.70..662,476.01 rows=503,531 width=869) (actual time=22,399.749..24,258.631 rows=711,958 loops=1)

  • Hash Cond: (deal_details_tnved_class.lu_timber_fkey = deal_details_timber_tnved.id)
6. 242.826 23,977.529 ↓ 1.4 711,958 1

Hash Left Join (cost=623,403.93..661,125.21 rows=503,531 width=871) (actual time=22,399.722..23,977.529 rows=711,958 loops=1)

  • Hash Cond: (deal_details.lu_tnved_class_fkey = deal_details_tnved_class.id)
7. 325.038 23,734.426 ↓ 1.4 711,958 1

Hash Left Join (cost=623,382.31..659,781.22 rows=503,531 width=739) (actual time=22,399.429..23,734.426 rows=711,958 loops=1)

  • Hash Cond: (deal_details.wood_class_fkey = deal_details_wood_class.id)
8. 904.964 23,409.140 ↓ 1.4 711,958 1

Hash Join (cost=623,349.01..653,112.51 rows=503,531 width=633) (actual time=22,399.126..23,409.140 rows=711,958 loops=1)

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

10. 886.978 22,387.086 ↓ 1.4 372,854 1

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

  • Buckets: 524288 (originally 262144) Batches: 1 (originally 1) Memory Usage: 268642kB
11. 5,733.839 21,500.108 ↓ 1.4 372,854 1

Gather (cost=457,037.51..620,087.80 rows=260,897 width=613) (actual time=18,094.669..21,500.108 rows=372,854 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
12. 70.069 15,766.269 ↓ 1.1 124,285 3

Hash Left Join (cost=456,037.51..592,998.10 rows=108,707 width=613) (actual time=12,618.962..15,766.269 rows=124,285 loops=3)

  • Hash Cond: (buyer_subject.bo_federal_district_fkey = buyer_federal_district.id)
13. 169.726 15,696.188 ↓ 1.1 124,285 3

Hash Left Join (cost=456,036.31..592,577.16 rows=108,707 width=556) (actual time=12,618.933..15,696.188 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. 68.809 15,526.252 ↓ 1.1 124,285 3

Hash Left Join (cost=456,033.40..591,161.06 rows=108,707 width=515) (actual time=12,618.693..15,526.252 rows=124,285 loops=3)

  • Hash Cond: (seller_subject.bo_federal_district_fkey = seller_federal_district.id)
15. 419.857 15,457.405 ↓ 1.1 124,285 3

Hash Left Join (cost=456,032.19..590,740.12 rows=108,707 width=458) (actual time=12,618.583..15,457.405 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. 233.631 15,037.211 ↓ 1.1 124,285 3

Hash Join (cost=456,029.28..589,324.02 rows=108,707 width=417) (actual time=12,618.204..15,037.211 rows=124,285 loops=3)

  • Hash Cond: ((party_buyer_no_golden.bo_party_golden_record_fkey)::text = (party_buyer.id)::text)
17. 160.540 10,389.344 ↓ 1.1 124,285 3

Hash Join (cost=345,705.26..478,714.64 rows=108,707 width=277) (actual time=8,137.055..10,389.344 rows=124,285 loops=3)

  • Hash Cond: ((deal.bo_party_buyer_fkey)::text = (party_buyer_no_golden.id)::text)
18. 226.981 8,873.305 ↓ 1.1 124,285 3

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

  • Hash Cond: ((party_seller_no_golden.bo_party_golden_record_fkey)::text = (party_seller.id)::text)
19. 142.195 4,208.011 ↓ 1.1 124,285 3

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

  • Hash Cond: ((deal.bo_party_seller_fkey)::text = (party_seller_no_golden.id)::text)
20. 548.391 2,416.789 ↓ 1.1 124,285 3

Hash Join (cost=24,489.18..156,642.51 rows=108,707 width=134) (actual time=551.702..2,416.789 rows=124,285 loops=3)

  • Hash Cond: ((base.id)::text = (deal.bo_document_fkey)::text)
21. 1,358.931 1,358.931 ↑ 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.243..1,358.931 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. 280.816 509.467 ↑ 1.0 425,956 3

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

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

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

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

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

26. 2,070.843 4,438.313 ↑ 1.0 1,951,201 3

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

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

28. 750.042 1,355.499 ↑ 1.0 1,951,201 3

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

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

30. 1,992.234 4,414.236 ↑ 1.0 1,951,201 3

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

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

32. 0.268 0.337 ↑ 1.0 85 3

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

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

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

34. 0.010 0.038 ↑ 1.0 9 3

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

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

36. 0.176 0.210 ↑ 1.0 85 3

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

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

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

38. 0.004 0.012 ↑ 1.0 9 3

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

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

40. 0.077 0.248 ↑ 1.0 220 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 36kB
41. 0.104 0.171 ↑ 1.0 220 1

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

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

43. 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
44. 0.009 0.009 ↑ 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.009..0.009 rows=2 loops=1)

45. 0.121 0.277 ↑ 1.0 294 1

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

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

47. 0.003 0.013 ↑ 195.0 2 1

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

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

49. 0.002 0.007 ↑ 1.0 4 1

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

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

51. 0.014 0.039 ↑ 1.0 4 1

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

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

53. 0.021 18.476 ↓ 2.0 2 1

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

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

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

55. 0.003 18.339 ↓ 2.0 2 1

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

56. 0.005 18.332 ↓ 2.0 2 1

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

57. 0.007 17.667 ↓ 2.0 2 1

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

58. 0.003 16.992 ↑ 1.0 1 1

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

59. 0.003 16.936 ↑ 1.0 1 1

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

60. 2.071 16.920 ↑ 1.0 1 1

Hash Right Join (cost=28.11..30.72 rows=1 width=647) (actual time=16.874..16.920 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.016 0.016 ↑ 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.008..0.016 rows=85 loops=1)

62. 0.017 14.833 ↑ 1.0 1 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
63. 0.005 14.816 ↑ 1.0 1 1

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

64. 0.004 14.782 ↑ 1.0 1 1

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

65. 5.491 14.768 ↑ 1.0 1 1

Hash Right Join (cost=16.90..19.50 rows=1 width=353) (actual time=14.726..14.768 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.028 0.028 ↑ 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.028 rows=85 loops=1)

67. 0.008 9.249 ↑ 1.0 1 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
68. 0.008 9.241 ↑ 1.0 1 1

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

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

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

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

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

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

  • Index Cond: (id = buyer_subject_1.bo_federal_district_fkey)
74. 0.053 0.053 ↑ 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.053..0.053 rows=1 loops=1)

  • Index Cond: (id = seller_subject_1.bo_federal_district_fkey)
75. 0.668 0.668 ↓ 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.664..0.668 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.006 0.660 ↑ 1.0 1 2

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

77. 0.562 0.562 ↑ 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.280..0.281 rows=1 loops=2)

  • Index Cond: (id = deal_details_1.wood_class_fkey)
78. 0.092 0.092 ↑ 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.046..0.046 rows=1 loops=2)

  • Index Cond: (id = deal_details_wood_class_1.lu_timber_fkey)
79. 0.002 0.004 ↓ 0.0 0 2

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

80. 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..2.42 rows=1 width=134) (actual time=0.001..0.001 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.112 0.112 ↑ 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.056..0.056 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 : 483.533 ms
Execution time : 25,006.417 ms