explain.depesz.com

PostgreSQL's explain analyze made readable

Result: ruCq

Settings
# exclusive inclusive rows x rows loops node
1. 4.665 138.108 ↓ 55.2 2,044 1

Sort (cost=317.31..317.40 rows=37 width=1,142) (actual time=137.860..138.108 rows=2,044 loops=1)

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

CTE uom_types

3. 0.040 0.040 ↑ 1.0 6 1

Seq Scan on uom_type (cost=0.00..1.14 rows=6 width=48) (actual time=0.027..0.040 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.001..0.002 rows=1 loops=1)

  • Filter: (internal_uom_type = 'LBS'::text)
  • Rows Removed by Filter: 5
6. 0.003 0.003 ↑ 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.003 rows=1 loops=1)

  • Filter: (internal_uom_type = 'CASE'::text)
  • Rows Removed by Filter: 5
7. 6.739 133.438 ↓ 55.2 2,044 1

Nested Loop (cost=8.71..314.94 rows=37 width=1,142) (actual time=0.424..133.438 rows=2,044 loops=1)

8. 0.014 0.014 ↑ 1.0 1 1

Seq Scan on client_settings (cost=0.00..1.01 rows=1 width=19) (actual time=0.011..0.014 rows=1 loops=1)

9. 1.211 126.685 ↓ 55.2 2,044 1

Nested Loop Left Join (cost=8.71..312.17 rows=37 width=260) (actual time=0.402..126.685 rows=2,044 loops=1)

10. 1.480 119.342 ↓ 55.2 2,044 1

Nested Loop Left Join (cost=8.44..301.35 rows=37 width=256) (actual time=0.392..119.342 rows=2,044 loops=1)

11. 1.238 101.510 ↓ 55.2 2,044 1

Nested Loop Left Join (cost=7.32..254.59 rows=37 width=278) (actual time=0.378..101.510 rows=2,044 loops=1)

12. 1.737 77.788 ↓ 55.2 2,044 1

Nested Loop (cost=6.20..207.84 rows=37 width=268) (actual time=0.344..77.788 rows=2,044 loops=1)

13. 1.717 71.963 ↓ 55.2 2,044 1

Nested Loop (cost=5.92..196.11 rows=37 width=280) (actual time=0.332..71.963 rows=2,044 loops=1)

14. 0.829 66.158 ↓ 55.2 2,044 1

Nested Loop (cost=5.64..183.59 rows=37 width=280) (actual time=0.321..66.158 rows=2,044 loops=1)

15. 2.028 61.241 ↓ 55.2 2,044 1

Nested Loop (cost=5.36..172.49 rows=37 width=296) (actual time=0.295..61.241 rows=2,044 loops=1)

16. 1.491 55.125 ↓ 55.2 2,044 1

Hash Join (cost=5.07..161.14 rows=37 width=296) (actual time=0.281..55.125 rows=2,044 loops=1)

  • Hash Cond: (sale.uom_type_id = price_uom.uom_type_id)
17. 1.322 53.585 ↓ 55.2 2,044 1

Nested Loop (cost=4.88..160.44 rows=37 width=296) (actual time=0.210..53.585 rows=2,044 loops=1)

18. 3.006 46.131 ↓ 55.2 2,044 1

Nested Loop (cost=4.46..144.27 rows=37 width=292) (actual time=0.197..46.131 rows=2,044 loops=1)

19. 1.794 34.949 ↓ 55.2 2,044 1

Nested Loop (cost=4.17..132.89 rows=37 width=176) (actual time=0.186..34.949 rows=2,044 loops=1)

20. 3.378 24.979 ↓ 55.2 2,044 1

Nested Loop (cost=3.89..121.75 rows=37 width=154) (actual time=0.175..24.979 rows=2,044 loops=1)

21. 1.665 13.425 ↓ 55.2 2,044 1

Nested Loop (cost=3.46..104.94 rows=37 width=60) (actual time=0.159..13.425 rows=2,044 loops=1)

22. 0.510 1.540 ↓ 157.2 2,044 1

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

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

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

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

  • Recheck Cond: (claim_id = claim.claim_id)
  • Heap Blocks: exact=68
25. 0.110 0.110 ↓ 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.109..0.110 rows=2,044 loops=1)

  • Index Cond: (claim_id = claim.claim_id)
26. 10.220 10.220 ↑ 1.0 1 2,044

Index Scan using sale_earning_claim_product_id_idx on sale_earning (cost=0.43..0.66 rows=1 width=76) (actual time=0.005..0.005 rows=1 loops=2,044)

  • Index Cond: (claim_product_id = claim_product.claim_product_id)
27. 8.176 8.176 ↑ 1.0 1 2,044

Index Scan using sale_pkey on sale (cost=0.42..0.45 rows=1 width=126) (actual time=0.004..0.004 rows=1 loops=2,044)

  • Index Cond: (sale_id = sale_earning.sale_id)
28. 8.176 8.176 ↑ 1.0 1 2,044

Index Scan using company_pkey on company distributor_company (cost=0.28..0.30 rows=1 width=38) (actual time=0.004..0.004 rows=1 loops=2,044)

  • Index Cond: (company_id = sale.company_id)
29. 8.176 8.176 ↑ 1.0 1 2,044

Index Scan using product_pkey on product (cost=0.29..0.31 rows=1 width=132) (actual time=0.004..0.004 rows=1 loops=2,044)

  • Index Cond: (product_id = sale.product_id)
30. 6.132 6.132 ↑ 1.0 1 2,044

Index Scan using contract_item_pkey on contract_item (cost=0.42..0.44 rows=1 width=36) (actual time=0.003..0.003 rows=1 loops=2,044)

  • Index Cond: (contract_item_id = sale_earning.contract_item_id)
31. 0.004 0.049 ↑ 1.0 6 1

Hash (cost=0.12..0.12 rows=6 width=16) (actual time=0.048..0.049 rows=6 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
32. 0.045 0.045 ↑ 1.0 6 1

CTE Scan on uom_types price_uom (cost=0.00..0.12 rows=6 width=16) (actual time=0.029..0.045 rows=6 loops=1)

33. 4.088 4.088 ↑ 1.0 1 2,044

Index Scan using contract_amend_version_pkey on contract_amend_version (cost=0.29..0.31 rows=1 width=32) (actual time=0.002..0.002 rows=1 loops=2,044)

  • Index Cond: (contract_amend_version_id = contract_item.contract_id)
34. 4.088 4.088 ↑ 1.0 1 2,044

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=2,044)

  • Index Cond: (company_id = sale_earning.claimant_company_id)
  • Heap Fetches: 0
35. 4.088 4.088 ↑ 1.0 1 2,044

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=2,044)

  • Index Cond: (contract_renew_version_id = contract_amend_version.contract_renew_version_id)
36. 4.088 4.088 ↑ 1.0 1 2,044

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=2,044)

  • Index Cond: (contract_family_id = contract_renew_version.contract_family_id)
37. 2.044 22.484 ↑ 1.0 1 2,044

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

38. 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.001..0.002 rows=1 loops=2,044)

  • Index Cond: (product_id = sale.product_id)
  • Heap Fetches: 0
39. 2.044 16.352 ↑ 1.0 1 2,044

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

40. 10.220 10.220 ↑ 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.005..0.005 rows=1 loops=2,044)

  • Index Cond: ((product_id = pro_1.product_id) AND (sale.uom_type_id = uom_type_id))
41. 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))
42. 0.000 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)

43. 4.088 4.088 ↑ 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.002 rows=1 loops=2,044)

  • Index Cond: (product_id = sale.product_id)
  • Heap Fetches: 0
44. 4.088 12.264 ↑ 1.0 1 2,044

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

45. 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))
46. 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))
47. 6.132 6.132 ↑ 1.0 1 2,044

Index Scan using company_unipro_number_pkey on company_unipro_number (cost=0.28..0.29 rows=1 width=36) (actual time=0.003..0.003 rows=1 loops=2,044)

  • Index Cond: (sale.company_id = company_id)
Planning time : 82.678 ms
Execution time : 138.792 ms