explain.depesz.com

PostgreSQL's explain analyze made readable

Result: YYVd

Settings
# exclusive inclusive rows x rows loops node
1. 3.228 1,419.366 ↓ 157.2 2,044 1

Sort (cost=285,032.42..285,032.45 rows=13 width=1,142) (actual time=1,396.990..1,419.366 rows=2,044 loops=1)

  • Sort Key: company_unipro_number.unipro_duns_number
  • Sort Method: quicksort Memory: 786kB
2.          

CTE uom_types

3. 0.061 0.061 ↑ 1.0 6 1

Seq Scan on uom_type (cost=0.00..1.14 rows=6 width=48) (actual time=0.041..0.061 rows=6 loops=1)

  • Filter: active_ind
4.          

Initplan (for Sort)

5. 0.002 0.002 ↑ 1.0 1 1

CTE Scan on uom_types (cost=0.00..0.14 rows=1 width=16) (actual time=0.002..0.002 rows=1 loops=1)

  • Filter: (internal_uom_type = 'LBS'::text)
  • Rows Removed by Filter: 5
6. 0.004 0.004 ↑ 1.0 1 1

CTE Scan on uom_types uom_types_1 (cost=0.00..0.14 rows=1 width=16) (actual time=0.003..0.004 rows=1 loops=1)

  • Filter: (internal_uom_type = 'CASE'::text)
  • Rows Removed by Filter: 5
7. 4.387 1,416.132 ↓ 157.2 2,044 1

Nested Loop Left Join (cost=1,102.08..285,030.77 rows=13 width=1,142) (actual time=1,332.094..1,416.132 rows=2,044 loops=1)

8. 0.184 1,399.481 ↓ 157.2 2,044 1

Nested Loop Left Join (cost=1,100.96..285,013.86 rows=13 width=301) (actual time=1,332.061..1,399.481 rows=2,044 loops=1)

9. 9.740 1,382.945 ↓ 157.2 2,044 1

Merge Semi Join (cost=1,099.85..284,997.43 rows=13 width=291) (actual time=1,332.015..1,382.945 rows=2,044 loops=1)

  • Merge Cond: (sale_earning.claim_product_id = claim_product.claim_product_id)
10. 23.060 1,371.460 ↑ 43.6 84,753 1

Nested Loop (cost=1,003.40..6,821,700.18 rows=3,692,235 width=307) (actual time=30.897..1,371.460 rows=84,753 loops=1)

11. 49.789 1,094.141 ↑ 43.6 84,753 1

Nested Loop (cost=1,003.11..5,710,503.80 rows=3,692,235 width=301) (actual time=30.878..1,094.141 rows=84,753 loops=1)

  • Join Filter: (price_uom.uom_type_id = sale.uom_type_id)
  • Rows Removed by Join Filter: 423,765
12. 0.000 959.599 ↑ 43.6 84,753 1

Gather Merge (cost=1,003.11..5,212,052.01 rows=3,692,235 width=301) (actual time=30.821..959.599 rows=84,753 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
13. 18.921 1,046.406 ↑ 54.1 28,414 3 / 3

Nested Loop Left Join (cost=3.09..4,784,876.45 rows=1,538,431 width=301) (actual time=1.865..1,046.406 rows=28,414 loops=3)

14. 38.120 970.657 ↑ 54.1 28,414 3 / 3

Nested Loop (cost=2.81..4,334,813.27 rows=1,538,431 width=281) (actual time=1.816..970.657 rows=28,414 loops=3)

15. 16.617 847.295 ↑ 54.1 28,414 3 / 3

Nested Loop (cost=2.53..3,861,703.96 rows=1,538,431 width=165) (actual time=1.773..847.295 rows=28,414 loops=3)

16. 23.105 603.366 ↑ 54.1 28,414 3 / 3

Nested Loop (cost=2.10..3,162,526.81 rows=1,538,431 width=71) (actual time=1.713..603.366 rows=28,414 loops=3)

17. 29.834 523.433 ↑ 54.1 28,414 3 / 3

Nested Loop (cost=1.82..2,675,079.52 rows=1,538,431 width=83) (actual time=1.666..523.433 rows=28,414 loops=3)

18. 6.589 436.771 ↑ 54.1 28,414 3 / 3

Nested Loop (cost=1.54..2,154,554.68 rows=1,538,431 width=83) (actual time=1.620..436.771 rows=28,414 loops=3)

19. 13.763 344.940 ↑ 54.1 28,414 3 / 3

Nested Loop (cost=1.25..1,682,561.62 rows=1,538,431 width=83) (actual time=0.212..344.940 rows=28,414 loops=3)

20. 10.472 217.521 ↑ 54.1 28,414 3 / 3

Nested Loop (cost=0.84..1,010,272.37 rows=1,538,431 width=79) (actual time=0.153..217.521 rows=28,414 loops=3)

21. 9.758 150.221 ↑ 54.1 28,414 3 / 3

Nested Loop (cost=0.55..548,691.90 rows=1,538,431 width=95) (actual time=0.087..150.221 rows=28,414 loops=3)

22. 83.635 83.635 ↑ 54.1 28,414 3 / 3

Parallel Index Scan using sale_earning_claim_product_id_idx on sale_earning (cost=0.43..314,078.92 rows=1,538,431 width=92) (actual time=0.034..83.635 rows=28,414 loops=3)

23. 56.828 56.828 ↑ 1.0 1 85,242 / 3

Index Scan using client_settings_pkey on client_settings (cost=0.12..0.14 rows=1 width=35) (actual time=0.002..0.002 rows=1 loops=85,242)

  • Index Cond: (client_id = sale_earning.client_id)
24. 56.828 56.828 ↑ 1.0 1 85,242 / 3

Index Only Scan using company_pkey on company claimant_company (cost=0.28..0.30 rows=1 width=16) (actual time=0.002..0.002 rows=1 loops=85,242)

  • Index Cond: (company_id = sale_earning.claimant_company_id)
  • Heap Fetches: 0
25. 113.656 113.656 ↑ 1.0 1 85,242 / 3

Index Scan using contract_item_pkey on contract_item (cost=0.42..0.44 rows=1 width=36) (actual time=0.004..0.004 rows=1 loops=85,242)

  • Index Cond: (contract_item_id = sale_earning.contract_item_id)
26. 85.242 85.242 ↑ 1.0 1 85,242 / 3

Index Scan using contract_amend_version_pkey on contract_amend_version (cost=0.29..0.31 rows=1 width=32) (actual time=0.003..0.003 rows=1 loops=85,242)

  • Index Cond: (contract_amend_version_id = contract_item.contract_id)
27. 56.828 56.828 ↑ 1.0 1 85,242 / 3

Index Scan using contract_renew_version_pkey on contract_renew_version (cost=0.28..0.34 rows=1 width=32) (actual time=0.002..0.002 rows=1 loops=85,242)

  • Index Cond: (contract_renew_version_id = contract_amend_version.contract_renew_version_id)
28. 56.828 56.828 ↑ 1.0 1 85,242 / 3

Index Scan using contract_family_pkey on contract_family (cost=0.28..0.32 rows=1 width=52) (actual time=0.002..0.002 rows=1 loops=85,242)

  • Index Cond: (contract_family_id = contract_renew_version.contract_family_id)
29. 227.312 227.312 ↑ 1.0 1 85,242 / 3

Index Scan using sale_pkey on sale (cost=0.42..0.45 rows=1 width=126) (actual time=0.008..0.008 rows=1 loops=85,242)

  • Index Cond: (sale_id = sale_earning.sale_id)
30. 85.242 85.242 ↑ 1.0 1 85,242 / 3

Index Scan using product_pkey on product (cost=0.29..0.31 rows=1 width=132) (actual time=0.003..0.003 rows=1 loops=85,242)

  • Index Cond: (product_id = sale.product_id)
31. 56.828 56.828 ↓ 0.0 0 85,242 / 3

Index Scan using company_unipro_number_pkey on company_unipro_number (cost=0.28..0.29 rows=1 width=36) (actual time=0.002..0.002 rows=0 loops=85,242)

  • Index Cond: (sale.company_id = company_id)
32. 84.753 84.753 ↑ 1.0 6 84,753

CTE Scan on uom_types price_uom (cost=0.00..0.12 rows=6 width=16) (actual time=0.000..0.001 rows=6 loops=84,753)

33. 254.259 254.259 ↑ 1.0 1 84,753

Index Scan using company_pkey on company distributor_company (cost=0.28..0.30 rows=1 width=38) (actual time=0.003..0.003 rows=1 loops=84,753)

  • Index Cond: (company_id = sale.company_id)
34. 1.033 1.745 ↓ 157.2 2,044 1

Sort (cost=96.45..96.48 rows=13 width=16) (actual time=1.283..1.745 rows=2,044 loops=1)

  • Sort Key: claim_product.claim_product_id
  • Sort Method: quicksort Memory: 144kB
35. 0.216 0.712 ↓ 157.2 2,044 1

Nested Loop (cost=3.03..96.21 rows=13 width=16) (actual time=0.142..0.712 rows=2,044 loops=1)

36. 0.018 0.018 ↑ 1.0 1 1

Index Scan using claim_invoice_id_idx on claim (cost=0.42..4.04 rows=1 width=16) (actual time=0.016..0.018 rows=1 loops=1)

  • Index Cond: (invoice_id = '90064c69-d603-4800-a07d-da0e84b0d2c3'::uuid)
37. 0.371 0.478 ↓ 40.9 2,044 1

Bitmap Heap Scan on claim_product (cost=2.62..91.67 rows=50 width=32) (actual time=0.118..0.478 rows=2,044 loops=1)

  • Recheck Cond: (claim_id = claim.claim_id)
  • Heap Blocks: exact=68
38. 0.107 0.107 ↓ 40.9 2,044 1

Bitmap Index Scan on claim_product_claim_id_idx (cost=0.00..2.60 rows=50 width=0) (actual time=0.107..0.107 rows=2,044 loops=1)

  • Index Cond: (claim_id = claim.claim_id)
39. 2.044 16.352 ↑ 1.0 1 2,044

Nested Loop (cost=1.12..1.25 rows=1 width=42) (actual time=0.007..0.008 rows=1 loops=2,044)

40. 4.088 4.088 ↑ 1.0 1 2,044

Index Only Scan using product_pkey on product pro_1 (cost=0.29..0.31 rows=1 width=16) (actual time=0.002..0.002 rows=1 loops=2,044)

  • Index Cond: (product_id = sale.product_id)
  • Heap Fetches: 0
41. 0.000 10.220 ↑ 1.0 1 2,044

Nested Loop (cost=0.83..0.94 rows=1 width=58) (actual time=0.005..0.005 rows=1 loops=2,044)

42. 6.132 6.132 ↑ 1.0 1 2,044

Index Scan using product_uom_conversion_pkey on product_uom_conversion suomc_1 (cost=0.41..0.48 rows=1 width=37) (actual time=0.003..0.003 rows=1 loops=2,044)

  • Index Cond: ((product_id = pro_1.product_id) AND (sale.uom_type_id = uom_type_id))
43. 4.088 4.088 ↑ 1.0 1 2,044

Index Scan using product_uom_conversion_pkey on product_uom_conversion tuomc_1 (cost=0.41..0.46 rows=1 width=21) (actual time=0.002..0.002 rows=1 loops=2,044)

  • Index Cond: ((product_id = suomc_1.product_id) AND (uom_type_id = $2))
44. 2.044 12.264 ↑ 1.0 1 2,044

Nested Loop (cost=1.12..1.25 rows=1 width=42) (actual time=0.005..0.006 rows=1 loops=2,044)

45. 2.044 2.044 ↑ 1.0 1 2,044

Index Only Scan using product_pkey on product pro (cost=0.29..0.31 rows=1 width=16) (actual time=0.001..0.001 rows=1 loops=2,044)

  • Index Cond: (product_id = sale.product_id)
  • Heap Fetches: 0
46. 0.000 8.176 ↑ 1.0 1 2,044

Nested Loop (cost=0.83..0.94 rows=1 width=58) (actual time=0.004..0.004 rows=1 loops=2,044)

47. 4.088 4.088 ↑ 1.0 1 2,044

Index Scan using product_uom_conversion_pkey on product_uom_conversion suomc (cost=0.41..0.48 rows=1 width=37) (actual time=0.002..0.002 rows=1 loops=2,044)

  • Index Cond: ((product_id = pro.product_id) AND (sale.uom_type_id = uom_type_id))
48. 4.088 4.088 ↑ 1.0 1 2,044

Index Scan using product_uom_conversion_pkey on product_uom_conversion tuomc (cost=0.41..0.46 rows=1 width=21) (actual time=0.002..0.002 rows=1 loops=2,044)

  • Index Cond: ((product_id = suomc.product_id) AND (uom_type_id = $1))
Planning time : 88.263 ms
Execution time : 1,419.857 ms