explain.depesz.com

PostgreSQL's explain analyze made readable

Result: fOa2

Settings
# exclusive inclusive rows x rows loops node
1. 72.850 2,489.913 ↓ 157.3 26,424 1

Hash Left Join (cost=152,585.59..159,801.35 rows=168 width=429) (actual time=645.282..2,489.913 rows=26,424 loops=1)

  • Output: claim_product.claim_product_id, claim_product.product_id, product.product_name, product.product_number, (array_agg(product_uom_conversion.uom_type_id)), claim_product.distributor_company_id, company.company_name, company.company_number, claim_product.uom_type_id, claim_product.rebate_calculated_rate, claim_product.rebate_requested_quantity, claim_product.rebate_requested_rate, claim_product.rebate_allowed_quantity, claim_product.rebate_allowed_rate, ((CASE WHEN (pm.math_operation_value IS NULL) THEN price_default.price WHEN (pm.math_operation IS NULL) THEN price_default.price WHEN (pm.math_operation = 'ADD'::enum.math_operation) THEN (price_default.price + pm.math_operation_value) WHEN (pm.math_operation = 'SUBTRACT'::enum.math_operation) THEN (price_default.price - pm.math_operation_value) WHEN (pm.math_operation = 'MULTIPLY'::enum.math_operation) THEN (price_default.price * pm.math_operation_value) ELSE price_default.price END / (tuomc.rate / suomc.rate))), ('DEFAULT'::enum.price_tier), claim_product.resolve_date, claim_product.claimant_contract_name, claim_product.contract_item_id, contract_item.contract_id, contract_family.contract_title, (((((contract_family_1.contract_sequence)::text || '.R'::text) || (contract_renew_version_view.contract_renew_version)::text) || '.A'::text) || (contract_amend_version_view.contract_amend_version)::text), contract_item.won, ((CASE WHEN (contract_family.contract_type = ANY ('{GROWTH_AUTOPAY,GROWTH_STANDARD}'::enum.contract_type[])) THEN 'GROWTH'::text WHEN ((contract_family.contract_type <> ALL ('{GROWTH_AUTOPAY,GROWTH_STANDARD}'::enum.contract_type[])) AND (ct.internal_company_type = 'LOCATION'::enum.internal_company_type) AND (claimant_company_type.internal_company_type = 'LOCATION'::enum.internal_company_type)) THEN 'DIRECT'::text WHEN ((contract_family.contract_type <> ALL ('{GROWTH_AUTOPAY,GROWTH_STANDARD}'::enum.contract_type[])) AND (ct.internal_company_type = 'LOCATION'::enum.internal_company_type) AND (claimant_company_type.internal_company_type = 'DISTRIBUTOR'::enum.internal_company_type)) THEN 'DEVIATED'::text WHEN ((contract_family.contract_type <> ALL ('{GROWTH_AUTOPAY,GROWTH_STANDARD}'::enum.contract_type[])) AND (ct.internal_company_type = 'DISTRIBUTOR'::enum.internal_company_type) AND (claimant_company_type.internal_company_type = 'DISTRIBUTOR'::enum.internal_company_type)) THEN 'DIRECT'::text ELSE NULL::text END)::enum.contract_rebate_method), CASE WHEN (((CASE WHEN (contract_family.contract_type = ANY ('{GROWTH_AUTOPAY,GROWTH_STANDARD}'::enum.contract_type[])) THEN 'GROWTH'::text WHEN ((contract_family.contract_type <> ALL ('{GROWTH_AUTOPAY,GROWTH_STANDARD}'::enum.contract_type[])) AND (ct.internal_company_type = 'LOCATION'::enum.internal_company_type) AND (claimant_company_type.internal_company_type = 'LOCATION'::enum.internal_company_type)) THEN 'DIRECT'::text WHEN ((contract_family.contract_type <> ALL ('{GROWTH_AUTOPAY,GROWTH_STANDARD}'::enum.contract_type[])) AND (ct.internal_company_type = 'LOCATION'::enum.internal_company_type) AND (claimant_company_type.internal_company_type = 'DISTRIBUTOR'::enum.internal_company_type)) THEN 'DEVIATED'::text WHEN ((contract_family.contract_type <> ALL ('{GROWTH_AUTOPAY,GROWTH_STANDARD}'::enum.contract_type[])) AND (ct.internal_company_type = 'DISTRIBUTOR'::enum.internal_company_type) AND (claimant_company_type.internal_company_type = 'DISTRIBUTOR'::enum.internal_company_type)) THEN 'DIRECT'::text ELSE NULL::text END)::enum.contract_rebate_method) = 'GROWTH'::enum.contract_rebate_method) THEN contract_item.rebate_growth_type WHEN (((CASE WHEN (contract_family.contract_type = ANY ('{GROWTH_AUTOPAY,GROWTH_STANDARD}'::enum.contract_type[])) THEN 'GROWTH'::text WHEN ((contract_family.contract_type <> ALL ('{GROWTH_AUTOPAY,GROWTH_STANDARD}'::enum.contract_type[])) AND (ct.internal_company_type = 'LOCATION'::enum.internal_company_type) AND (claimant_company_type.internal_company_type = 'LOCATION'::enum.internal_company_type)) THEN 'DIRECT'::text WHEN ((contract_family.contract_type <> ALL ('{GROWTH_AUTOPAY,GROWTH_STANDARD}'::enum.contract_type[])) AND (ct.internal_company_type = 'LOCATION'::enum.internal_company_type) AND (claimant_company_type.internal_company_type = 'DISTRIBUTOR'::enum.internal_company_type)) THEN 'DEVIATED'::text WHEN ((contract_family.contract_type <> ALL ('{GROWTH_AUTOPAY,GROWTH_STANDARD}'::enum.contract_type[])) AND (ct.internal_company_type = 'DISTRIBUTOR'::enum.internal_company_type) AND (claimant_company_type.internal_company_type = 'DISTRIBUTOR'::enum.internal_company_type)) THEN 'DIRECT'::text ELSE NULL::text END)::enum.contract_rebate_method) = 'DIRECT'::enum.contract_rebate_method) THEN contract_item.rebate_direct_type WHEN (((CASE WHEN (contract_family.contract_type = ANY ('{GROWTH_AUTOPAY,GROWTH_STANDARD}'::enum.contract_type[])) THEN 'GROWTH'::text WHEN ((contract_family.contract_type <> ALL ('{GROWTH_AUTOPAY,GROWTH_STANDARD}'::enum.contract_type[])) AND (ct.internal_company_type = 'LOCATION'::enum.internal_company_type) AND (claimant_company_type.internal_company_type = 'LOCATION'::enum.internal_company_type)) THEN 'DIRECT'::text WHEN ((contract_family.contract_type <> ALL ('{GROWTH_AUTOPAY,GROWTH_STANDARD}'::enum.contract_type[])) AND (ct.internal_company_type = 'LOCATION'::enum.internal_company_type) AND (claimant_company_type.internal_company_type = 'DISTRIBUTOR'::enum.internal_company_type)) THEN 'DEVIATED'::text WHEN ((contract_family.contract_type <> ALL ('{GROWTH_AUTOPAY,GROWTH_STANDARD}'::enum.contract_type[])) AND (ct.internal_company_type = 'DISTRIBUTOR'::enum.internal_company_type) AND (claimant_company_type.internal_company_type = 'DISTRIBUTOR'::enum.internal_company_type)) THEN 'DIRECT'::text ELSE NULL::text END)::enum.contract_rebate_method) = 'DEVIATED'::enum.contract_rebate_method) THEN contract_item.rebate_deviated_type ELSE NULL::enum.rebate_value_type END, CASE WHEN (((CASE WHEN (contract_family.contract_type = ANY ('{GROWTH_AUTOPAY,GROWTH_STANDARD}'::enum.contract_type[])) THEN 'GROWTH'::text WHEN ((contract_family.contract_type <> ALL ('{GROWTH_AUTOPAY,GROWTH_STANDARD}'::enum.contract_type[])) AND (ct.internal_company_type = 'LOCATION'::enum.internal_company_type) AND (claimant_company_type.internal_company_type = 'LOCATION'::enum.internal_company_type)) THEN 'DIRECT'::text WHEN ((contract_family.contract_type <> ALL ('{GROWTH_AUTOPAY,GROWTH_STANDARD}'::enum.contract_type[])) AND (ct.internal_company_type = 'LOCATION'::enum.internal_company_type) AND (claimant_company_type.internal_company_type = 'DISTRIBUTOR'::enum.internal_company_type)) THEN 'DEVIATED'::text WHEN ((contract_family.contract_type <> ALL ('{GROWTH_AUTOPAY,GROWTH_STANDARD}'::enum.contract_type[])) AND (ct.internal_company_type = 'DISTRIBUTOR'::enum.internal_company_type) AND (claimant_company_type.internal_company_type = 'DISTRIBUTOR'::enum.internal_company_type)) THEN 'DIRECT'::text ELSE NULL::text END)::enum.contract_rebate_method) = 'GROWTH'::enum.contract_rebate_method) THEN contract_item.rebate_growth_decimal_model WHEN (((CASE WHEN (contract_family.contract_type = ANY ('{GROWTH_AUTOPAY,GROWTH_STANDARD}'::enum.contract_type[])) THEN 'GROWTH'::text WHEN ((contract_family.contract_type <> ALL ('{GROWTH_AUTOPAY,GROWTH_STANDARD}'::enum.contract_type[])) AND (ct.internal_company_type = 'LOCATION'::enum.internal_company_type) AND (claimant_company_type.internal_company_type = 'LOCATION'::enum.internal_company_type)) THEN 'DIRECT'::text WHEN ((contract_family.contract_type <> ALL ('{GROWTH_AUTOPAY,GROWTH_STANDARD}'::enum.contract_type[])) AND (ct.internal_company_type = 'LOCATION'::enum.internal_company_type) AND (claimant_company_type.internal_company_type = 'DISTRIBUTOR'::enum.internal_company_type)) THEN 'DEVIATED'::text WHEN ((contract_family.contract_type <> ALL ('{GROWTH_AUTOPAY,GROWTH_STANDARD}'::enum.contract_type[])) AND (ct.internal_company_type = 'DISTRIBUTOR'::enum.internal_company_type) AND (claimant_company_type.internal_company_type = 'DISTRIBUTOR'::enum.internal_company_type)) THEN 'DIRECT'::text ELSE NULL::text END)::enum.contract_rebate_method) = 'DIRECT'::enum.contract_rebate_method) THEN contract_item.rebate_direct_decimal_model WHEN (((CASE WHEN (contract_family.contract_type = ANY ('{GROWTH_AUTOPAY,GROWTH_STANDARD}'::enum.contract_type[])) THEN 'GROWTH'::text WHEN ((contract_family.contract_type <> ALL ('{GROWTH_AUTOPAY,GROWTH_STANDARD}'::enum.contract_type[])) AND (ct.internal_company_type = 'LOCATION'::enum.internal_company_type) AND (claimant_company_type.internal_company_type = 'LOCATION'::enum.internal_company_type)) THEN 'DIRECT'::text WHEN ((contract_family.contract_type <> ALL ('{GROWTH_AUTOPAY,GROWTH_STANDARD}'::enum.contract_type[])) AND (ct.internal_company_type = 'LOCATION'::enum.internal_company_type) AND (claimant_company_type.internal_company_type = 'DISTRIBUTOR'::enum.internal_company_type)) THEN 'DEVIATED'::text WHEN ((contract_family.contract_type <> ALL ('{GROWTH_AUTOPAY,GROWTH_STANDARD}'::enum.contract_type[])) AND (ct.internal_company_type = 'DISTRIBUTOR'::enum.internal_company_type) AND (claimant_company_type.internal_company_type = 'DISTRIBUTOR'::enum.internal_company_type)) THEN 'DIRECT'::text ELSE NULL::text END)::enum.contract_rebate_method) = 'DEVIATED'::enum.contract_rebate_method) THEN contract_item.rebate_deviated_decimal_model ELSE NULL::enum.decimal_model END, CASE ((CASE WHEN (contract_family.contract_type = ANY ('{GROWTH_AUTOPAY,GROWTH_STANDARD}'::enum.contract_type[])) THEN 'GROWTH'::text WHEN ((contract_family.contract_type <> ALL ('{GROWTH_AUTOPAY,GROWTH_STANDARD}'::enum.contract_type[])) AND (ct.internal_company_type = 'LOCATION'::enum.internal_company_type) AND (claimant_company_type.internal_company_type = 'LOCATION'::enum.internal_company_type)) THEN 'DIRECT'::text WHEN ((contract_family.contract_type <> ALL ('{GROWTH_AUTOPAY,GROWTH_STANDARD}'::enum.contract_type[])) AND (ct.internal_company_type = 'LOCATION'::enum.internal_company_type) AND (claimant_company_type.internal_company_type = 'DISTRIBUTOR'::enum.internal_company_type)) THEN 'DEVIATED'::text WHEN ((contract_family.contract_type <> ALL ('{GROWTH_AUTOPAY,GROWTH_STANDARD}'::enum.contract_type[])) AND (ct.internal_company_type = 'DISTRIBUTOR'::enum.internal_company_type) AND (claimant_company_type.internal_company_type = 'DISTRIBUTOR'::enum.internal_company_type)) THEN 'DIRECT'::text ELSE NULL::text END)::enum.contract_rebate_method) WHEN 'GROWTH'::enum.contract_rebate_method THEN NULL::numeric WHEN 'DIRECT'::enum.contract_rebate_method THEN CASE WHEN (contract_item.rebate_direct_type = 'FIXED_RATE'::enum.rebate_value_type) THEN CASE WHEN (contract_item.rebate_direct_decimal_model = 'NUMERIC'::enum.decimal_model) THEN (contract_item.rebate_direct_value / (tuomc_1.rate / suomc_1.rate)) WHEN (contract_item.rebate_direct_decimal_model = 'PERCENT'::enum.decimal_model) THEN contract_item.rebate_direct_value ELSE NULL::numeric END WHEN (contract_item.rebate_direct_type = 'FIXED_PRICE'::enum.rebate_value_type) THEN CASE WHEN (contract_item.rebate_direct_decimal_model = 'NUMERIC'::enum.decimal_model) THEN (contract_item.rebate_direct_value / (tuomc_1.rate / suomc_1.rate)) ELSE NULL::numeric END ELSE NULL::numeric END WHEN 'DEVIATED'::enum.contract_rebate_method THEN CASE WHEN (contract_item.rebate_deviated_type = 'FIXED_RATE'::enum.rebate_value_type) THEN CASE WHEN (contract_item.rebate_deviated_decimal_model = 'NUMERIC'::enum.decimal_model) THEN (contract_item.rebate_deviated_value / (tuomc_1.rate / suomc_1.rate)) WHEN (contract_item.rebate_deviated_decimal_model = 'PERCENT'::enum.decimal_model) THEN contract_item.rebate_deviated_value ELSE NULL::numeric END WHEN (contract_item.rebate_deviated_type = 'FIXED_PRICE'::enum.rebate_value_type) THEN CASE WHEN (contract_item.rebate_deviated_decimal_model = 'NUMERIC'::enum.decimal_model) THEN (contract_item.rebate_deviated_value / (tuomc_1.rate / suomc_1.rate)) ELSE NULL::numeric END ELSE NULL::numeric END ELSE NULL::numeric END, COALESCE(claim_product.distributor_invoice_number, cpl.distributor_invoice_number), (cpo.display_order)::integer
  • Inner Unique: true
  • Hash Cond: ((claim_product.claim_id = cpl.claim_id) AND (claim_product.claim_product_id = cpl.claim_product_id))
  • Buffers: shared hit=1484009, temp read=1261 written=1259
2. 18.651 2,246.396 ↓ 157.3 26,424 1

Nested Loop Left Join (cost=74,601.13..81,800.05 rows=168 width=415) (actual time=474.530..2,246.396 rows=26,424 loops=1)

  • Output: claim_product.claim_product_id, claim_product.product_id, claim_product.distributor_company_id, claim_product.uom_type_id, claim_product.rebate_calculated_rate, claim_product.rebate_requested_quantity, claim_product.rebate_requested_rate, claim_product.rebate_allowed_quantity, claim_product.rebate_allowed_rate, claim_product.resolve_date, claim_product.claimant_contract_name, claim_product.contract_item_id, claim_product.distributor_invoice_number, claim_product.claim_id, company.company_name, company.company_number, product.product_name, product.product_number, contract_item.contract_id, contract_item.won, contract_item.rebate_growth_type, contract_item.rebate_direct_type, contract_item.rebate_deviated_type, contract_item.rebate_growth_decimal_model, contract_item.rebate_direct_decimal_model, contract_item.rebate_deviated_decimal_model, contract_item.rebate_direct_value, contract_item.rebate_deviated_value, contract_family_1.contract_sequence, contract_renew_version_view.contract_renew_version, contract_amend_version_view.contract_amend_version, ('DEFAULT'::enum.price_tier), (array_agg(product_uom_conversion.uom_type_id)), contract_family.contract_title, suomc_1.rate, tuomc_1.rate, cpo.display_order, ((CASE WHEN (contract_family.contract_type = ANY ('{GROWTH_AUTOPAY,GROWTH_STANDARD}'::enum.contract_type[])) THEN 'GROWTH'::text WHEN ((contract_family.contract_type <> ALL ('{GROWTH_AUTOPAY,GROWTH_STANDARD}'::enum.contract_type[])) AND (ct.internal_company_type = 'LOCATION'::enum.internal_company_type) AND (claimant_company_type.internal_company_type = 'LOCATION'::enum.internal_company_type)) THEN 'DIRECT'::text WHEN ((contract_family.contract_type <> ALL ('{GROWTH_AUTOPAY,GROWTH_STANDARD}'::enum.contract_type[])) AND (ct.internal_company_type = 'LOCATION'::enum.internal_company_type) AND (claimant_company_type.internal_company_type = 'DISTRIBUTOR'::enum.internal_company_type)) THEN 'DEVIATED'::text WHEN ((contract_family.contract_type <> ALL ('{GROWTH_AUTOPAY,GROWTH_STANDARD}'::enum.contract_type[])) AND (ct.internal_company_type = 'DISTRIBUTOR'::enum.internal_company_type) AND (claimant_company_type.internal_company_type = 'DISTRIBUTOR'::enum.internal_company_type)) THEN 'DIRECT'::text ELSE NULL::text END)::enum.contract_rebate_method), ((CASE WHEN (pm.math_operation_value IS NULL) THEN price_default.price WHEN (pm.math_operation IS NULL) THEN price_default.price WHEN (pm.math_operation = 'ADD'::enum.math_operation) THEN (price_default.price + pm.math_operation_value) WHEN (pm.math_operation = 'SUBTRACT'::enum.math_operation) THEN (price_default.price - pm.math_operation_value) WHEN (pm.math_operation = 'MULTIPLY'::enum.math_operation) THEN (price_default.price * pm.math_operation_value) ELSE price_default.price END / (tuomc.rate / suomc.rate)))
  • Buffers: shared hit=1356952, temp read=1261 written=1259
3. 35.953 2,201.321 ↓ 157.3 26,424 1

Nested Loop Left Join (cost=74,601.13..81,789.97 rows=168 width=423) (actual time=474.516..2,201.321 rows=26,424 loops=1)

  • Output: claim_product.claim_product_id, claim_product.product_id, claim_product.distributor_company_id, claim_product.uom_type_id, claim_product.rebate_calculated_rate, claim_product.rebate_requested_quantity, claim_product.rebate_requested_rate, claim_product.rebate_allowed_quantity, claim_product.rebate_allowed_rate, claim_product.resolve_date, claim_product.claimant_contract_name, claim_product.contract_item_id, claim_product.distributor_invoice_number, claim_product.claim_id, claimant_company_type.internal_company_type, company.company_name, company.company_number, product.product_name, product.product_number, contract_item.contract_id, contract_item.won, contract_item.rebate_growth_type, contract_item.rebate_direct_type, contract_item.rebate_deviated_type, contract_item.rebate_growth_decimal_model, contract_item.rebate_direct_decimal_model, contract_item.rebate_deviated_decimal_model, contract_item.rebate_direct_value, contract_item.rebate_deviated_value, contract_family_1.contract_sequence, contract_renew_version_view.contract_renew_version, contract_amend_version_view.contract_amend_version, ('DEFAULT'::enum.price_tier), (array_agg(product_uom_conversion.uom_type_id)), contract_family.contract_title, contract_family.contract_type, suomc_1.rate, tuomc_1.rate, cpo.display_order, ct.internal_company_type, ((CASE WHEN (pm.math_operation_value IS NULL) THEN price_default.price WHEN (pm.math_operation IS NULL) THEN price_default.price WHEN (pm.math_operation = 'ADD'::enum.math_operation) THEN (price_default.price + pm.math_operation_value) WHEN (pm.math_operation = 'SUBTRACT'::enum.math_operation) THEN (price_default.price - pm.math_operation_value) WHEN (pm.math_operation = 'MULTIPLY'::enum.math_operation) THEN (price_default.price * pm.math_operation_value) ELSE price_default.price END / (tuomc.rate / suomc.rate)))
  • Buffers: shared hit=1356952, temp read=1261 written=1259
4. 35.114 1,953.976 ↓ 157.3 26,424 1

Hash Left Join (cost=74,600.29..81,596.00 rows=168 width=435) (actual time=474.440..1,953.976 rows=26,424 loops=1)

  • Output: claim_product.claim_product_id, claim_product.product_id, claim_product.distributor_company_id, claim_product.uom_type_id, claim_product.rebate_calculated_rate, claim_product.rebate_requested_quantity, claim_product.rebate_requested_rate, claim_product.rebate_allowed_quantity, claim_product.rebate_allowed_rate, claim_product.resolve_date, claim_product.claimant_contract_name, claim_product.contract_item_id, claim_product.distributor_invoice_number, claim_product.claim_id, claimant_company_type.internal_company_type, company.company_name, company.company_number, product.product_name, product.product_number, contract_item.contract_id, contract_item.won, contract_item.rebate_growth_type, contract_item.rebate_direct_type, contract_item.rebate_deviated_type, contract_item.rebate_growth_decimal_model, contract_item.rebate_direct_decimal_model, contract_item.rebate_deviated_decimal_model, contract_item.rebate_direct_value, contract_item.rebate_deviated_value, contract_family_1.contract_sequence, contract_renew_version_view.contract_renew_version, contract_amend_version_view.contract_amend_version, ('DEFAULT'::enum.price_tier), (array_agg(product_uom_conversion.uom_type_id)), contract_family.contract_title, contract_family.contract_type, contract_family.contract_family_id, suomc_1.rate, tuomc_1.rate, cpo.display_order, ((CASE WHEN (pm.math_operation_value IS NULL) THEN price_default.price WHEN (pm.math_operation IS NULL) THEN price_default.price WHEN (pm.math_operation = 'ADD'::enum.math_operation) THEN (price_default.price + pm.math_operation_value) WHEN (pm.math_operation = 'SUBTRACT'::enum.math_operation) THEN (price_default.price - pm.math_operation_value) WHEN (pm.math_operation = 'MULTIPLY'::enum.math_operation) THEN (price_default.price * pm.math_operation_value) ELSE price_default.price END / (tuomc.rate / suomc.rate)))
  • Hash Cond: ((claim_product.claim_id = claim_product_order.claim_id) AND (claim_product.claim_product_id = cpo.claim_product_id))
  • Buffers: shared hit=1145560, temp read=1261 written=1259
5. 30.586 1,903.754 ↓ 157.3 26,424 1

Nested Loop Left Join (cost=74,593.35..81,587.79 rows=168 width=427) (actual time=459.315..1,903.754 rows=26,424 loops=1)

  • Output: claim_product.claim_product_id, claim_product.product_id, claim_product.distributor_company_id, claim_product.uom_type_id, claim_product.rebate_calculated_rate, claim_product.rebate_requested_quantity, claim_product.rebate_requested_rate, claim_product.rebate_allowed_quantity, claim_product.rebate_allowed_rate, claim_product.resolve_date, claim_product.claimant_contract_name, claim_product.contract_item_id, claim_product.distributor_invoice_number, claim_product.claim_id, claimant_company_type.internal_company_type, company.company_name, company.company_number, product.product_name, product.product_number, contract_item.contract_id, contract_item.won, contract_item.rebate_growth_type, contract_item.rebate_direct_type, contract_item.rebate_deviated_type, contract_item.rebate_growth_decimal_model, contract_item.rebate_direct_decimal_model, contract_item.rebate_deviated_decimal_model, contract_item.rebate_direct_value, contract_item.rebate_deviated_value, contract_family_1.contract_sequence, contract_renew_version_view.contract_renew_version, contract_amend_version_view.contract_amend_version, ('DEFAULT'::enum.price_tier), (array_agg(product_uom_conversion.uom_type_id)), contract_family.contract_title, contract_family.contract_type, contract_family.contract_family_id, suomc_1.rate, tuomc_1.rate, ((CASE WHEN (pm.math_operation_value IS NULL) THEN price_default.price WHEN (pm.math_operation IS NULL) THEN price_default.price WHEN (pm.math_operation = 'ADD'::enum.math_operation) THEN (price_default.price + pm.math_operation_value) WHEN (pm.math_operation = 'SUBTRACT'::enum.math_operation) THEN (price_default.price - pm.math_operation_value) WHEN (pm.math_operation = 'MULTIPLY'::enum.math_operation) THEN (price_default.price * pm.math_operation_value) ELSE price_default.price END / (tuomc.rate / suomc.rate)))
  • Join Filter: (contract_item.uom_type_id = suomc_1.uom_type_id)
  • Rows Removed by Join Filter: 1048
  • Buffers: shared hit=1145499, temp read=1261 written=1259
6. 21.159 1,688.200 ↓ 157.3 26,424 1

Hash Left Join (cost=74,592.51..81,424.17 rows=168 width=433) (actual time=459.285..1,688.200 rows=26,424 loops=1)

  • Output: claim_product.claim_product_id, claim_product.product_id, claim_product.distributor_company_id, claim_product.uom_type_id, claim_product.rebate_calculated_rate, claim_product.rebate_requested_quantity, claim_product.rebate_requested_rate, claim_product.rebate_allowed_quantity, claim_product.rebate_allowed_rate, claim_product.resolve_date, claim_product.claimant_contract_name, claim_product.contract_item_id, claim_product.distributor_invoice_number, claim_product.claim_id, claimant_company_type.internal_company_type, company.company_name, company.company_number, product.product_name, product.product_number, contract_item.contract_id, contract_item.won, contract_item.rebate_growth_type, contract_item.rebate_direct_type, contract_item.rebate_deviated_type, contract_item.rebate_growth_decimal_model, contract_item.rebate_direct_decimal_model, contract_item.rebate_deviated_decimal_model, contract_item.rebate_direct_value, contract_item.rebate_deviated_value, contract_item.uom_type_id, contract_family_1.contract_sequence, contract_renew_version_view.contract_renew_version, contract_amend_version_view.contract_amend_version, ('DEFAULT'::enum.price_tier), (array_agg(product_uom_conversion.uom_type_id)), contract_family.contract_title, contract_family.contract_type, contract_family.contract_family_id, ((CASE WHEN (pm.math_operation_value IS NULL) THEN price_default.price WHEN (pm.math_operation IS NULL) THEN price_default.price WHEN (pm.math_operation = 'ADD'::enum.math_operation) THEN (price_default.price + pm.math_operation_value) WHEN (pm.math_operation = 'SUBTRACT'::enum.math_operation) THEN (price_default.price - pm.math_operation_value) WHEN (pm.math_operation = 'MULTIPLY'::enum.math_operation) THEN (price_default.price * pm.math_operation_value) ELSE price_default.price END / (tuomc.rate / suomc.rate)))
  • Inner Unique: true
  • Hash Cond: (claim.contract_sequence = contract_family.contract_sequence)
  • Buffers: shared hit=930962, temp read=1261 written=1259
7. 16.211 1,664.160 ↓ 157.3 26,424 1

Nested Loop Left Join (cost=74,233.71..81,064.93 rows=168 width=387) (actual time=456.376..1,664.160 rows=26,424 loops=1)

  • Output: claim_product.claim_product_id, claim_product.product_id, claim_product.distributor_company_id, claim_product.uom_type_id, claim_product.rebate_calculated_rate, claim_product.rebate_requested_quantity, claim_product.rebate_requested_rate, claim_product.rebate_allowed_quantity, claim_product.rebate_allowed_rate, claim_product.resolve_date, claim_product.claimant_contract_name, claim_product.contract_item_id, claim_product.distributor_invoice_number, claim_product.claim_id, claim.contract_sequence, claimant_company_type.internal_company_type, company.company_name, company.company_number, product.product_name, product.product_number, contract_item.contract_id, contract_item.won, contract_item.rebate_growth_type, contract_item.rebate_direct_type, contract_item.rebate_deviated_type, contract_item.rebate_growth_decimal_model, contract_item.rebate_direct_decimal_model, contract_item.rebate_deviated_decimal_model, contract_item.rebate_direct_value, contract_item.rebate_deviated_value, contract_item.uom_type_id, contract_family_1.contract_sequence, contract_renew_version_view.contract_renew_version, contract_amend_version_view.contract_amend_version, ('DEFAULT'::enum.price_tier), (array_agg(product_uom_conversion.uom_type_id)), ((CASE WHEN (pm.math_operation_value IS NULL) THEN price_default.price WHEN (pm.math_operation IS NULL) THEN price_default.price WHEN (pm.math_operation = 'ADD'::enum.math_operation) THEN (price_default.price + pm.math_operation_value) WHEN (pm.math_operation = 'SUBTRACT'::enum.math_operation) THEN (price_default.price - pm.math_operation_value) WHEN (pm.math_operation = 'MULTIPLY'::enum.math_operation) THEN (price_default.price * pm.math_operation_value) ELSE price_default.price END / (tuomc.rate / suomc.rate)))
  • Buffers: shared hit=930731, temp read=1261 written=1259
8. 42.255 485.293 ↓ 157.3 26,424 1

Hash Right Join (cost=74,231.46..75,079.28 rows=168 width=351) (actual time=456.234..485.293 rows=26,424 loops=1)

  • Output: claim_product.claim_product_id, claim_product.product_id, claim_product.distributor_company_id, claim_product.uom_type_id, claim_product.rebate_calculated_rate, claim_product.rebate_requested_quantity, claim_product.rebate_requested_rate, claim_product.rebate_allowed_quantity, claim_product.rebate_allowed_rate, claim_product.resolve_date, claim_product.claimant_contract_name, claim_product.contract_item_id, claim_product.distributor_invoice_number, claim_product.claim_id, claim.contract_sequence, claimant_company_type.internal_company_type, company.company_name, company.company_number, product.product_name, product.product_number, contract_item.contract_id, contract_item.won, contract_item.rebate_growth_type, contract_item.rebate_direct_type, contract_item.rebate_deviated_type, contract_item.rebate_growth_decimal_model, contract_item.rebate_direct_decimal_model, contract_item.rebate_deviated_decimal_model, contract_item.rebate_direct_value, contract_item.rebate_deviated_value, contract_item.uom_type_id, contract_family_1.contract_sequence, contract_renew_version_view.contract_renew_version, contract_amend_version_view.contract_amend_version, (array_agg(product_uom_conversion.uom_type_id))
  • Hash Cond: (contract_amend_version.contract_amend_version_id = contract_item.contract_id)
  • Buffers: shared hit=149542, temp read=1261 written=1259
9. 8.164 116.019 ↑ 1.0 18,396 1

Hash Join (cost=5,754.27..6,416.46 rows=18,396 width=36) (actual time=84.406..116.019 rows=18,396 loops=1)

  • Output: contract_family_1.contract_sequence, contract_renew_version_view.contract_renew_version, contract_amend_version.contract_amend_version_id, contract_amend_version_view.contract_amend_version
  • Inner Unique: true
  • Hash Cond: (contract_amend_version.contract_amend_version_id = contract_amend_version_view.contract_amend_version_id)
  • Buffers: shared hit=1539
10. 6.946 65.280 ↑ 1.0 18,396 1

Hash Join (cost=2,858.18..3,472.06 rows=18,396 width=28) (actual time=41.749..65.280 rows=18,396 loops=1)

  • Output: contract_family_1.contract_sequence, contract_renew_version_view.contract_renew_version, contract_amend_version.contract_amend_version_id
  • Inner Unique: true
  • Hash Cond: (contract_renew_version.contract_renew_version_id = contract_renew_version_view.contract_renew_version_id)
  • Buffers: shared hit=969
11. 5.983 24.085 ↑ 1.0 18,396 1

Hash Join (cost=807.59..1,373.17 rows=18,396 width=52) (actual time=7.455..24.085 rows=18,396 loops=1)

  • Output: contract_family_1.contract_sequence, contract_renew_version.contract_renew_version_id, contract_amend_version.contract_renew_version_id, contract_amend_version.contract_amend_version_id
  • Inner Unique: true
  • Hash Cond: (contract_renew_version.contract_family_id = contract_family_1.contract_family_id)
  • Buffers: shared hit=667
12. 8.539 15.713 ↑ 1.0 18,396 1

Hash Join (cost=448.79..966.05 rows=18,396 width=64) (actual time=5.031..15.713 rows=18,396 loops=1)

  • Output: contract_renew_version.contract_family_id, contract_renew_version.contract_renew_version_id, contract_amend_version.contract_renew_version_id, contract_amend_version.contract_amend_version_id
  • Inner Unique: true
  • Hash Cond: (contract_amend_version.contract_renew_version_id = contract_renew_version.contract_renew_version_id)
  • Buffers: shared hit=436
13. 2.186 2.186 ↑ 1.0 18,396 1

Seq Scan on client_pinnacle.contract_amend_version (cost=0.00..468.96 rows=18,396 width=32) (actual time=0.008..2.186 rows=18,396 loops=1)

  • Output: contract_amend_version.contract_amend_version_id, contract_amend_version.contract_renew_version_id, contract_amend_version.contract_state, contract_amend_version.contract_amend_version_parent_id, contract_amend_version.contract_name, contract_amend_version.contact_name, contract_amend_version.contact_email, contract_amend_version.contact_phone, contract_amend_version.create_timestamp
  • Buffers: shared hit=285
14. 2.511 4.988 ↑ 1.0 13,235 1

Hash (cost=283.35..283.35 rows=13,235 width=32) (actual time=4.988..4.988 rows=13,235 loops=1)

  • Output: contract_renew_version.contract_family_id, contract_renew_version.contract_renew_version_id
  • Buckets: 16384 Batches: 1 Memory Usage: 956kB
  • Buffers: shared hit=151
15. 2.477 2.477 ↑ 1.0 13,235 1

Seq Scan on client_pinnacle.contract_renew_version (cost=0.00..283.35 rows=13,235 width=32) (actual time=0.006..2.477 rows=13,235 loops=1)

  • Output: contract_renew_version.contract_family_id, contract_renew_version.contract_renew_version_id
  • Buffers: shared hit=151
16. 1.030 2.389 ↑ 1.0 5,680 1

Hash (cost=287.80..287.80 rows=5,680 width=20) (actual time=2.389..2.389 rows=5,680 loops=1)

  • Output: contract_family_1.contract_sequence, contract_family_1.contract_family_id
  • Buckets: 8192 Batches: 1 Memory Usage: 353kB
  • Buffers: shared hit=231
17. 1.359 1.359 ↑ 1.0 5,680 1

Seq Scan on client_pinnacle.contract_family contract_family_1 (cost=0.00..287.80 rows=5,680 width=20) (actual time=0.027..1.359 rows=5,680 loops=1)

  • Output: contract_family_1.contract_sequence, contract_family_1.contract_family_id
  • Buffers: shared hit=231
18. 2.954 34.249 ↑ 1.0 13,235 1

Hash (cost=1,885.15..1,885.15 rows=13,235 width=24) (actual time=34.249..34.249 rows=13,235 loops=1)

  • Output: contract_renew_version_view.contract_renew_version, contract_renew_version_view.contract_renew_version_id
  • Buckets: 16384 Batches: 1 Memory Usage: 852kB
  • Buffers: shared hit=302
19. 2.072 31.295 ↑ 1.0 13,235 1

Subquery Scan on contract_renew_version_view (cost=1,620.45..1,885.15 rows=13,235 width=24) (actual time=25.851..31.295 rows=13,235 loops=1)

  • Output: contract_renew_version_view.contract_renew_version, contract_renew_version_view.contract_renew_version_id
  • Buffers: shared hit=302
20. 11.572 29.223 ↑ 1.0 13,235 1

HashAggregate (cost=1,620.45..1,752.80 rows=13,235 width=24) (actual time=25.849..29.223 rows=13,235 loops=1)

  • Output: crv1.contract_renew_version_id, count(crv2.contract_renew_version_id)
  • Group Key: crv1.contract_renew_version_id
  • Buffers: shared hit=302
21. 11.409 17.651 ↓ 1.8 24,312 1

Hash Left Join (cost=448.79..1,554.28 rows=13,235 width=32) (actual time=5.070..17.651 rows=24,312 loops=1)

  • Output: crv1.contract_renew_version_id, crv2.contract_renew_version_id
  • Hash Cond: (crv1.contract_family_id = crv2.contract_family_id)
  • Join Filter: (crv2.create_timestamp < crv1.create_timestamp)
  • Rows Removed by Join Filter: 32009
  • Buffers: shared hit=302
22. 1.213 1.213 ↑ 1.0 13,235 1

Seq Scan on client_pinnacle.contract_renew_version crv1 (cost=0.00..283.35 rows=13,235 width=40) (actual time=0.008..1.213 rows=13,235 loops=1)

  • Output: crv1.contract_renew_version_id, crv1.contract_family_id, crv1.date_range, crv1.create_timestamp, crv1.dead
  • Buffers: shared hit=151
23. 2.603 5.029 ↑ 1.0 13,235 1

Hash (cost=283.35..283.35 rows=13,235 width=40) (actual time=5.029..5.029 rows=13,235 loops=1)

  • Output: crv2.contract_renew_version_id, crv2.contract_family_id, crv2.create_timestamp
  • Buckets: 16384 Batches: 1 Memory Usage: 1059kB
  • Buffers: shared hit=151
24. 2.426 2.426 ↑ 1.0 13,235 1

Seq Scan on client_pinnacle.contract_renew_version crv2 (cost=0.00..283.35 rows=13,235 width=40) (actual time=0.004..2.426 rows=13,235 loops=1)

  • Output: crv2.contract_renew_version_id, crv2.contract_family_id, crv2.create_timestamp
  • Buffers: shared hit=151
25. 3.987 42.575 ↑ 1.0 18,396 1

Hash (cost=2,666.15..2,666.15 rows=18,396 width=24) (actual time=42.574..42.575 rows=18,396 loops=1)

  • Output: contract_amend_version_view.contract_amend_version, contract_amend_version_view.contract_amend_version_id
  • Buckets: 32768 Batches: 1 Memory Usage: 1263kB
  • Buffers: shared hit=570
26. 2.860 38.588 ↑ 1.0 18,396 1

Subquery Scan on contract_amend_version_view (cost=2,298.23..2,666.15 rows=18,396 width=24) (actual time=31.303..38.588 rows=18,396 loops=1)

  • Output: contract_amend_version_view.contract_amend_version, contract_amend_version_view.contract_amend_version_id
  • Buffers: shared hit=570
27. 12.795 35.728 ↑ 1.0 18,396 1

HashAggregate (cost=2,298.23..2,482.19 rows=18,396 width=24) (actual time=31.301..35.728 rows=18,396 loops=1)

  • Output: cav1.contract_amend_version_id, count(cav2.contract_amend_version_id)
  • Group Key: cav1.contract_amend_version_id
  • Buffers: shared hit=570
28. 12.966 22.933 ↓ 1.1 19,996 1

Hash Left Join (cost=698.91..2,206.25 rows=18,396 width=32) (actual time=8.270..22.933 rows=19,996 loops=1)

  • Output: cav1.contract_amend_version_id, cav2.contract_amend_version_id
  • Hash Cond: (cav1.contract_renew_version_id = cav2.contract_renew_version_id)
  • Join Filter: (cav2.create_timestamp < cav1.create_timestamp)
  • Rows Removed by Join Filter: 32398
  • Buffers: shared hit=570
29. 1.773 1.773 ↑ 1.0 18,396 1

Seq Scan on client_pinnacle.contract_amend_version cav1 (cost=0.00..468.96 rows=18,396 width=40) (actual time=0.012..1.773 rows=18,396 loops=1)

  • Output: cav1.contract_amend_version_id, cav1.contract_renew_version_id, cav1.contract_state, cav1.contract_amend_version_parent_id, cav1.contract_name, cav1.contact_name, cav1.contact_email, cav1.contact_phone, cav1.create_timestamp
  • Buffers: shared hit=285
30. 3.875 8.194 ↑ 1.0 18,396 1

Hash (cost=468.96..468.96 rows=18,396 width=40) (actual time=8.194..8.194 rows=18,396 loops=1)

  • Output: cav2.contract_amend_version_id, cav2.contract_renew_version_id, cav2.create_timestamp
  • Buckets: 32768 Batches: 1 Memory Usage: 1550kB
  • Buffers: shared hit=285
31. 4.319 4.319 ↑ 1.0 18,396 1

Seq Scan on client_pinnacle.contract_amend_version cav2 (cost=0.00..468.96 rows=18,396 width=40) (actual time=0.005..4.319 rows=18,396 loops=1)

  • Output: cav2.contract_amend_version_id, cav2.contract_renew_version_id, cav2.create_timestamp
  • Buffers: shared hit=285
32. 33.663 327.019 ↓ 157.3 26,424 1

Hash (cost=68,475.09..68,475.09 rows=168 width=331) (actual time=327.019..327.019 rows=26,424 loops=1)

  • Output: claim_product.claim_product_id, claim_product.product_id, claim_product.distributor_company_id, claim_product.uom_type_id, claim_product.rebate_calculated_rate, claim_product.rebate_requested_quantity, claim_product.rebate_requested_rate, claim_product.rebate_allowed_quantity, claim_product.rebate_allowed_rate, claim_product.resolve_date, claim_product.claimant_contract_name, claim_product.contract_item_id, claim_product.distributor_invoice_number, claim_product.claim_id, claim.contract_sequence, claimant_company_type.internal_company_type, company.company_name, company.company_number, product.product_name, product.product_number, (array_agg(product_uom_conversion.uom_type_id)), contract_item.contract_id, contract_item.won, contract_item.rebate_growth_type, contract_item.rebate_direct_type, contract_item.rebate_deviated_type, contract_item.rebate_growth_decimal_model, contract_item.rebate_direct_decimal_model, contract_item.rebate_deviated_decimal_model, contract_item.rebate_direct_value, contract_item.rebate_deviated_value, contract_item.uom_type_id
  • Buckets: 32768 (originally 1024) Batches: 2 (originally 1) Memory Usage: 9836kB
  • Buffers: shared hit=148003, temp written=1190
33. 20.847 293.356 ↓ 157.3 26,424 1

Nested Loop Left Join (cost=67,316.45..68,475.09 rows=168 width=331) (actual time=171.868..293.356 rows=26,424 loops=1)

  • Output: claim_product.claim_product_id, claim_product.product_id, claim_product.distributor_company_id, claim_product.uom_type_id, claim_product.rebate_calculated_rate, claim_product.rebate_requested_quantity, claim_product.rebate_requested_rate, claim_product.rebate_allowed_quantity, claim_product.rebate_allowed_rate, claim_product.resolve_date, claim_product.claimant_contract_name, claim_product.contract_item_id, claim_product.distributor_invoice_number, claim_product.claim_id, claim.contract_sequence, claimant_company_type.internal_company_type, company.company_name, company.company_number, product.product_name, product.product_number, (array_agg(product_uom_conversion.uom_type_id)), contract_item.contract_id, contract_item.won, contract_item.rebate_growth_type, contract_item.rebate_direct_type, contract_item.rebate_deviated_type, contract_item.rebate_growth_decimal_model, contract_item.rebate_direct_decimal_model, contract_item.rebate_deviated_decimal_model, contract_item.rebate_direct_value, contract_item.rebate_deviated_value, contract_item.uom_type_id
  • Inner Unique: true
  • Buffers: shared hit=148003
34. 22.115 219.661 ↓ 157.3 26,424 1

Hash Join (cost=67,316.02..68,250.62 rows=168 width=267) (actual time=171.840..219.661 rows=26,424 loops=1)

  • Output: claim_product.claim_product_id, claim_product.product_id, claim_product.distributor_company_id, claim_product.uom_type_id, claim_product.rebate_calculated_rate, claim_product.rebate_requested_quantity, claim_product.rebate_requested_rate, claim_product.rebate_allowed_quantity, claim_product.rebate_allowed_rate, claim_product.resolve_date, claim_product.claimant_contract_name, claim_product.contract_item_id, claim_product.distributor_invoice_number, claim_product.claim_id, claim.contract_sequence, claimant_company_type.internal_company_type, company.company_name, company.company_number, product.product_name, product.product_number, (array_agg(product_uom_conversion.uom_type_id))
  • Hash Cond: (claim_product_2.claim_product_id = claim_product.claim_product_id)
  • Buffers: shared hit=42307
35. 23.400 88.509 ↑ 1.0 26,424 1

GroupAggregate (cost=34,245.75..34,800.03 rows=27,537 width=64) (actual time=62.743..88.509 rows=26,424 loops=1)

  • Output: claim_product_2.claim_id, claim_product_2.claim_product_id, array_agg(product_uom_conversion.uom_type_id)
  • Group Key: claim_product_2.claim_product_id
  • Buffers: shared hit=20996
36. 13.217 65.109 ↑ 1.0 27,472 1

Sort (cost=34,245.75..34,315.77 rows=28,009 width=48) (actual time=62.723..65.109 rows=27,472 loops=1)

  • Output: claim_product_2.claim_product_id, claim_product_2.claim_id, product_uom_conversion.uom_type_id
  • Sort Key: claim_product_2.claim_product_id
  • Sort Method: quicksort Memory: 2915kB
  • Buffers: shared hit=20996
37. 10.926 51.892 ↑ 1.0 27,472 1

Hash Join (cost=467.00..32,176.78 rows=28,009 width=48) (actual time=8.401..51.892 rows=27,472 loops=1)

  • Output: claim_product_2.claim_product_id, claim_product_2.claim_id, product_uom_conversion.uom_type_id
  • Hash Cond: (claim_product_2.product_id = product_uom_conversion.product_id)
  • Buffers: shared hit=20996
38. 36.484 40.023 ↑ 1.0 26,424 1

Bitmap Heap Scan on client_pinnacle.claim_product claim_product_2 (cost=389.34..31,681.35 rows=27,537 width=48) (actual time=7.435..40.023 rows=26,424 loops=1)

  • Output: claim_product_2.claim_id, claim_product_2.claim_product_id, claim_product_2.product_id
  • Recheck Cond: (claim_product_2.claim_id = '2c3c9316-267c-4439-b4d6-e0f137e32fdf'::uuid)
  • Heap Blocks: exact=20870
  • Buffers: shared hit=20975
39. 3.539 3.539 ↑ 1.0 26,424 1

Bitmap Index Scan on claim_product_claim_id_idx (cost=0.00..382.46 rows=27,537 width=0) (actual time=3.539..3.539 rows=26,424 loops=1)

  • Index Cond: (claim_product_2.claim_id = '2c3c9316-267c-4439-b4d6-e0f137e32fdf'::uuid)
  • Buffers: shared hit=105
40. 0.505 0.943 ↑ 1.0 2,518 1

Hash (cost=46.18..46.18 rows=2,518 width=32) (actual time=0.943..0.943 rows=2,518 loops=1)

  • Output: product_uom_conversion.uom_type_id, product_uom_conversion.product_id
  • Buckets: 4096 Batches: 1 Memory Usage: 190kB
  • Buffers: shared hit=21
41. 0.438 0.438 ↑ 1.0 2,518 1

Seq Scan on client_pinnacle.product_uom_conversion (cost=0.00..46.18 rows=2,518 width=32) (actual time=0.015..0.438 rows=2,518 loops=1)

  • Output: product_uom_conversion.uom_type_id, product_uom_conversion.product_id
  • Buffers: shared hit=21
42. 18.692 109.037 ↑ 1.0 26,424 1

Hash (cost=32,726.06..32,726.06 rows=27,537 width=235) (actual time=109.037..109.037 rows=26,424 loops=1)

  • Output: claim_product.claim_product_id, claim_product.product_id, claim_product.distributor_company_id, claim_product.uom_type_id, claim_product.rebate_calculated_rate, claim_product.rebate_requested_quantity, claim_product.rebate_requested_rate, claim_product.rebate_allowed_quantity, claim_product.rebate_allowed_rate, claim_product.resolve_date, claim_product.claimant_contract_name, claim_product.contract_item_id, claim_product.distributor_invoice_number, claim_product.claim_id, claim.contract_sequence, claimant_company_type.internal_company_type, company.company_name, company.company_number, product.product_name, product.product_number
  • Buckets: 32768 Batches: 1 Memory Usage: 7257kB
  • Buffers: shared hit=21311
43. 12.564 90.345 ↑ 1.0 26,424 1

Hash Join (cost=1,007.88..32,726.06 rows=27,537 width=235) (actual time=17.641..90.345 rows=26,424 loops=1)

  • Output: claim_product.claim_product_id, claim_product.product_id, claim_product.distributor_company_id, claim_product.uom_type_id, claim_product.rebate_calculated_rate, claim_product.rebate_requested_quantity, claim_product.rebate_requested_rate, claim_product.rebate_allowed_quantity, claim_product.rebate_allowed_rate, claim_product.resolve_date, claim_product.claimant_contract_name, claim_product.contract_item_id, claim_product.distributor_invoice_number, claim_product.claim_id, claim.contract_sequence, claimant_company_type.internal_company_type, company.company_name, company.company_number, product.product_name, product.product_number
  • Inner Unique: true
  • Hash Cond: (claim_product.product_id = product.product_id)
  • Buffers: shared hit=21311
44. 10.967 75.498 ↑ 1.0 26,424 1

Hash Left Join (cost=882.24..32,528.02 rows=27,537 width=197) (actual time=15.344..75.498 rows=26,424 loops=1)

  • Output: claim_product.claim_product_id, claim_product.product_id, claim_product.distributor_company_id, claim_product.uom_type_id, claim_product.rebate_calculated_rate, claim_product.rebate_requested_quantity, claim_product.rebate_requested_rate, claim_product.rebate_allowed_quantity, claim_product.rebate_allowed_rate, claim_product.resolve_date, claim_product.claimant_contract_name, claim_product.contract_item_id, claim_product.distributor_invoice_number, claim_product.claim_id, claim.contract_sequence, claimant_company_type.internal_company_type, company.company_name, company.company_number
  • Inner Unique: true
  • Hash Cond: (claim_product.distributor_company_id = company.company_id)
  • Buffers: shared hit=21242
45. 5.340 59.267 ↑ 1.0 26,424 1

Nested Loop (cost=390.60..31,964.06 rows=27,537 width=166) (actual time=10.033..59.267 rows=26,424 loops=1)

  • Output: claim_product.claim_product_id, claim_product.product_id, claim_product.distributor_company_id, claim_product.uom_type_id, claim_product.rebate_calculated_rate, claim_product.rebate_requested_quantity, claim_product.rebate_requested_rate, claim_product.rebate_allowed_quantity, claim_product.rebate_allowed_rate, claim_product.resolve_date, claim_product.claimant_contract_name, claim_product.contract_item_id, claim_product.distributor_invoice_number, claim_product.claim_id, claim.contract_sequence, claimant_company_type.internal_company_type
  • Buffers: shared hit=20988
46. 0.003 0.069 ↑ 1.0 1 1

Nested Loop (cost=1.25..7.34 rows=1 width=24) (actual time=0.062..0.069 rows=1 loops=1)

  • Output: claim.claim_id, claim.contract_sequence, claimant_company_type.internal_company_type
  • Inner Unique: true
  • Buffers: shared hit=13
47. 0.004 0.059 ↑ 1.0 1 1

Nested Loop (cost=1.12..7.18 rows=1 width=36) (actual time=0.053..0.059 rows=1 loops=1)

  • Output: claim.claim_id, claim.contract_sequence, claimant_company.company_type_id
  • Inner Unique: true
  • Buffers: shared hit=11
48. 0.005 0.044 ↑ 1.0 1 1

Nested Loop (cost=0.84..6.88 rows=1 width=36) (actual time=0.039..0.044 rows=1 loops=1)

  • Output: claim.claim_id, claim.contract_sequence, invoice.claimant_company_id
  • Inner Unique: true
  • Buffers: shared hit=8
49. 0.025 0.025 ↑ 1.0 1 1

Index Scan using claim_pkey on client_pinnacle.claim (cost=0.42..3.44 rows=1 width=36) (actual time=0.021..0.025 rows=1 loops=1)

  • Output: claim.claim_id, claim.invoice_id, claim.claim_state, claim.claim_sequence, claim.transaction_type, claim.contract_sequence, claim.claim_tag
  • Index Cond: (claim.claim_id = '2c3c9316-267c-4439-b4d6-e0f137e32fdf'::uuid)
  • Buffers: shared hit=4
50. 0.014 0.014 ↑ 1.0 1 1

Index Scan using invoice_pkey on client_pinnacle.invoice (cost=0.42..3.44 rows=1 width=32) (actual time=0.014..0.014 rows=1 loops=1)

  • Output: invoice.invoice_id, invoice.claimant_company_id
  • Index Cond: (invoice.invoice_id = claim.invoice_id)
  • Buffers: shared hit=4
51. 0.011 0.011 ↑ 1.0 1 1

Index Scan using company_pkey on client_pinnacle.company claimant_company (cost=0.29..0.31 rows=1 width=32) (actual time=0.011..0.011 rows=1 loops=1)

  • Output: claimant_company.company_id, claimant_company.client_id, claimant_company.company_name, claimant_company.company_number, claimant_company.company_type_id, claimant_company.active_ind, claimant_company.address_1, claimant_company.address_2, claimant_company.address_3, claimant_company.address_4, claimant_company.city, claimant_company.region, claimant_company.postal_code, claimant_company.country, claimant_company.company_agg_id, claimant_company.deduction_interval, claimant_company.alt_address_active, claimant_company.alt_address_1, claimant_company.alt_address_2, claimant_company.alt_address_3, claimant_company.alt_address_4, claimant_company.alt_city, claimant_company.alt_region, claimant_company.alt_postal_code, claimant_company.alt_country, claimant_company.atlas_company_id, claimant_company.email, claimant_company.tax_type_id, claimant_company.redistributor_ind, claimant_company.operator_request, claimant_company.early_payment_discount, claimant_company.vip
  • Index Cond: (claimant_company.company_id = invoice.claimant_company_id)
  • Buffers: shared hit=3
52. 0.007 0.007 ↑ 1.0 1 1

Index Scan using company_type_pkey on client_pinnacle.company_type claimant_company_type (cost=0.13..0.15 rows=1 width=20) (actual time=0.007..0.007 rows=1 loops=1)

  • Output: claimant_company_type.company_type_id, claimant_company_type.client_id, claimant_company_type.company_type_description, claimant_company_type.company_type_cd, claimant_company_type.active_ind, claimant_company_type.internal_company_type
  • Index Cond: (claimant_company_type.company_type_id = claimant_company.company_type_id)
  • Buffers: shared hit=2
53. 48.779 53.858 ↑ 1.0 26,424 1

Bitmap Heap Scan on client_pinnacle.claim_product (cost=389.34..31,681.35 rows=27,537 width=158) (actual time=9.962..53.858 rows=26,424 loops=1)

  • Output: claim_product.claim_product_id, claim_product.product_id, claim_product.distributor_company_id, claim_product.uom_type_id, claim_product.rebate_calculated_rate, claim_product.rebate_requested_quantity, claim_product.rebate_requested_rate, claim_product.rebate_allowed_quantity, claim_product.rebate_allowed_rate, claim_product.resolve_date, claim_product.claimant_contract_name, claim_product.contract_item_id, claim_product.distributor_invoice_number, claim_product.claim_id
  • Recheck Cond: (claim_product.claim_id = '2c3c9316-267c-4439-b4d6-e0f137e32fdf'::uuid)
  • Heap Blocks: exact=20870
  • Buffers: shared hit=20975
54. 5.079 5.079 ↑ 1.0 26,424 1

Bitmap Index Scan on claim_product_claim_id_idx (cost=0.00..382.46 rows=27,537 width=0) (actual time=5.079..5.079 rows=26,424 loops=1)

  • Index Cond: (claim_product.claim_id = '2c3c9316-267c-4439-b4d6-e0f137e32fdf'::uuid)
  • Buffers: shared hit=105
55. 2.743 5.264 ↑ 1.0 10,562 1

Hash (cost=359.62..359.62 rows=10,562 width=47) (actual time=5.264..5.264 rows=10,562 loops=1)

  • Output: company.company_name, company.company_number, company.company_id
  • Buckets: 16384 Batches: 1 Memory Usage: 956kB
  • Buffers: shared hit=254
56. 2.521 2.521 ↑ 1.0 10,562 1

Seq Scan on client_pinnacle.company (cost=0.00..359.62 rows=10,562 width=47) (actual time=0.016..2.521 rows=10,562 loops=1)

  • Output: company.company_name, company.company_number, company.company_id
  • Buffers: shared hit=254
57. 1.282 2.283 ↑ 1.0 2,517 1

Hash (cost=94.17..94.17 rows=2,517 width=54) (actual time=2.283..2.283 rows=2,517 loops=1)

  • Output: product.product_name, product.product_number, product.product_id
  • Buckets: 4096 Batches: 1 Memory Usage: 247kB
  • Buffers: shared hit=69
58. 1.001 1.001 ↑ 1.0 2,517 1

Seq Scan on client_pinnacle.product (cost=0.00..94.17 rows=2,517 width=54) (actual time=0.013..1.001 rows=2,517 loops=1)

  • Output: product.product_name, product.product_number, product.product_id
  • Buffers: shared hit=69
59. 52.848 52.848 ↑ 1.0 1 26,424

Index Scan using contract_item_pkey on client_pinnacle.contract_item (cost=0.42..1.34 rows=1 width=80) (actual time=0.002..0.002 rows=1 loops=26,424)

  • Output: contract_item.contract_item_id, contract_item.contract_id, contract_item.product_id, contract_item.grouping_id, contract_item.estimated_quantity, contract_item.uom_type_id, contract_item.rebate_deviated_value, contract_item.rebate_deviated_type, contract_item.inactive_override, contract_item.rebate_direct_value, contract_item.rebate_direct_type, contract_item.rebate_direct_decimal_model, contract_item.rebate_deviated_decimal_model, contract_item.won, contract_item.rebate_growth_type, contract_item.rebate_growth_decimal_model
  • Index Cond: (claim_product.contract_item_id = contract_item.contract_item_id)
  • Buffers: shared hit=105696
60. 59.028 1,162.656 ↑ 1.0 1 26,424

Nested Loop Left Join (cost=2.26..35.62 rows=1 width=68) (actual time=0.034..0.044 rows=1 loops=26,424)

  • Output: claim_product_1.claim_product_id, claim_product_1.claim_id, ('DEFAULT'::enum.price_tier), (CASE WHEN (pm.math_operation_value IS NULL) THEN price_default.price WHEN (pm.math_operation IS NULL) THEN price_default.price WHEN (pm.math_operation = 'ADD'::enum.math_operation) THEN (price_default.price + pm.math_operation_value) WHEN (pm.math_operation = 'SUBTRACT'::enum.math_operation) THEN (price_default.price - pm.math_operation_value) WHEN (pm.math_operation = 'MULTIPLY'::enum.math_operation) THEN (price_default.price * pm.math_operation_value) ELSE price_default.price END / (tuomc.rate / suomc.rate))
  • Buffers: shared hit=781189
61. 27.454 792.720 ↑ 1.0 1 26,424

Nested Loop (cost=1.98..35.29 rows=1 width=70) (actual time=0.020..0.030 rows=1 loops=26,424)

  • Output: claim_product_1.claim_product_id, claim_product_1.claim_id, ('DEFAULT'::enum.price_tier), price_default.price_id, price_default.price, suomc.rate, tuomc.rate
  • Inner Unique: true
  • Join Filter: ((pro.product_id = tuomc.product_id) AND (claim_product_1.uom_type_id = tuomc.uom_type_id))
  • Rows Removed by Join Filter: 0
  • Buffers: shared hit=703462
62. 27.454 713.448 ↑ 1.0 1 26,424

Nested Loop (cost=1.70..34.98 rows=1 width=129) (actual time=0.018..0.027 rows=1 loops=26,424)

  • Output: claim_product_1.claim_product_id, claim_product_1.uom_type_id, claim_product_1.claim_id, ('DEFAULT'::enum.price_tier), price_default.product_id, price_default.price_id, price_default.price, pro.product_id, suomc.product_id, suomc.rate
  • Inner Unique: true
  • Join Filter: (suomc.product_id = pro.product_id)
  • Buffers: shared hit=625735
63. 27.454 634.176 ↑ 1.0 1 26,424

Nested Loop (cost=1.42..34.67 rows=1 width=113) (actual time=0.015..0.024 rows=1 loops=26,424)

  • Output: claim_product_1.claim_product_id, claim_product_1.uom_type_id, claim_product_1.claim_id, ('DEFAULT'::enum.price_tier), price_default.product_id, price_default.price_id, price_default.price, suomc.product_id, suomc.rate
  • Inner Unique: true
  • Buffers: shared hit=573916
64. 32.089 554.904 ↑ 96.0 1 26,424

Nested Loop (cost=1.14..5.87 rows=96 width=108) (actual time=0.012..0.021 rows=1 loops=26,424)

  • Output: claim_product_1.claim_product_id, claim_product_1.uom_type_id, claim_product_1.claim_id, ('DEFAULT'::enum.price_tier), price_default.product_id, price_default.uom_type_id, price_default.price_id, price_default.price
  • Buffers: shared hit=496189
65. 26.424 237.816 ↑ 1.0 1 26,424

Nested Loop (cost=0.86..4.28 rows=1 width=64) (actual time=0.009..0.009 rows=1 loops=26,424)

  • Output: claim_product_1.claim_product_id, claim_product_1.uom_type_id, claim_product_1.claim_id, claim_product_price.price_id
  • Inner Unique: true
  • Buffers: shared hit=211190
66. 132.120 132.120 ↑ 1.0 1 26,424

Index Scan using claim_product_pkey on client_pinnacle.claim_product claim_product_1 (cost=0.43..2.62 rows=1 width=48) (actual time=0.004..0.005 rows=1 loops=26,424)

  • Output: claim_product_1.claim_product_id, claim_product_1.uom_type_id, claim_product_1.claim_id
  • Index Cond: (claim_product.claim_product_id = claim_product_1.claim_product_id)
  • Filter: ((claim_product_1.claim_id = '2c3c9316-267c-4439-b4d6-e0f137e32fdf'::uuid) AND (claim_product.claim_id = claim_product_1.claim_id))
  • Buffers: shared hit=105905
67. 79.272 79.272 ↑ 1.0 1 26,424

Index Scan using claim_product_price_unique on client_pinnacle.claim_product_price (cost=0.43..1.66 rows=1 width=32) (actual time=0.003..0.003 rows=1 loops=26,424)

  • Output: claim_product_price.claim_product_id, claim_product_price.price_id
  • Index Cond: (claim_product_price.claim_product_id = claim_product_1.claim_product_id)
  • Buffers: shared hit=105285
68. 0.000 284.999 ↑ 5.0 1 25,909

Append (cost=0.28..1.53 rows=5 width=60) (actual time=0.003..0.011 rows=1 loops=25,909)

  • Buffers: shared hit=284999
69. 77.727 77.727 ↑ 1.0 1 25,909

Index Scan using price_default_pkey on client_pinnacle.price_default (cost=0.28..0.30 rows=1 width=58) (actual time=0.002..0.003 rows=1 loops=25,909)

  • Output: 'DEFAULT'::enum.price_tier, price_default.product_id, price_default.uom_type_id, price_default.price_id, price_default.price
  • Index Cond: (price_default.price_id = claim_product_price.price_id)
  • Buffers: shared hit=77727
70. 77.727 77.727 ↓ 0.0 0 25,909

Index Scan using price_generated_pkey on client_pinnacle.price_sale (cost=0.43..0.47 rows=1 width=60) (actual time=0.003..0.003 rows=0 loops=25,909)

  • Output: 'SALE'::enum.price_tier, price_sale.product_id, price_sale.uom_type_id, price_sale.price_id, price_sale.price
  • Index Cond: (price_sale.price_id = claim_product_price.price_id)
  • Buffers: shared hit=77727
71. 51.818 51.818 ↓ 0.0 0 25,909

Index Scan using price_company_pkey on client_pinnacle.price_company (cost=0.29..0.30 rows=1 width=58) (actual time=0.002..0.002 rows=0 loops=25,909)

  • Output: 'COMPANY'::enum.price_tier, price_company.product_id, price_company.uom_type_id, price_company.price_id, price_company.price
  • Index Cond: (price_company.price_id = claim_product_price.price_id)
  • Buffers: shared hit=51818
72. 25.909 25.909 ↓ 0.0 0 25,909

Index Scan using price_list_pkey on client_pinnacle.price_list (cost=0.15..0.17 rows=1 width=84) (actual time=0.001..0.001 rows=0 loops=25,909)

  • Output: 'LIST'::enum.price_tier, price_list.product_id, price_list.uom_type_id, price_list.price_id, price_list.price
  • Index Cond: (price_list.price_id = claim_product_price.price_id)
  • Buffers: shared hit=25909
73. 51.818 51.818 ↓ 0.0 0 25,909

Index Scan using price_class_pkey on client_pinnacle.price_class (cost=0.28..0.30 rows=1 width=58) (actual time=0.002..0.002 rows=0 loops=25,909)

  • Output: 'CLASS'::enum.price_tier, price_class.product_id, price_class.uom_type_id, price_class.price_id, price_class.price
  • Index Cond: (price_class.price_id = claim_product_price.price_id)
  • Buffers: shared hit=51818
74. 51.818 51.818 ↑ 1.0 1 25,909

Index Scan using product_uom_conversion_pkey on client_pinnacle.product_uom_conversion suomc (cost=0.28..0.30 rows=1 width=37) (actual time=0.002..0.002 rows=1 loops=25,909)

  • Output: suomc.product_id, suomc.uom_type_id, suomc.rate
  • Index Cond: ((suomc.product_id = price_default.product_id) AND (suomc.uom_type_id = price_default.uom_type_id))
  • Buffers: shared hit=77727
75. 51.818 51.818 ↑ 1.0 1 25,909

Index Only Scan using product_pkey on client_pinnacle.product pro (cost=0.28..0.30 rows=1 width=16) (actual time=0.002..0.002 rows=1 loops=25,909)

  • Output: pro.product_id
  • Index Cond: (pro.product_id = price_default.product_id)
  • Heap Fetches: 0
  • Buffers: shared hit=51819
76. 51.818 51.818 ↑ 1.0 1 25,909

Index Scan using product_uom_conversion_pkey on client_pinnacle.product_uom_conversion tuomc (cost=0.28..0.30 rows=1 width=37) (actual time=0.001..0.002 rows=1 loops=25,909)

  • Output: tuomc.product_id, tuomc.uom_type_id, tuomc.rate
  • Index Cond: (tuomc.product_id = price_default.product_id)
  • Buffers: shared hit=77727
77. 310.908 310.908 ↓ 0.0 0 25,909

Index Scan using price_modified_excl on client_pinnacle.price_modified pm (cost=0.28..0.30 rows=1 width=27) (actual time=0.012..0.012 rows=0 loops=25,909)

  • Output: pm.price_id, pm.math_operation_value, pm.math_operation
  • Index Cond: (price_default.price_id = pm.price_id)
  • Filter: upper_inf(pm.active_range)
  • Buffers: shared hit=77727
78. 1.297 2.881 ↑ 1.0 5,680 1

Hash (cost=287.80..287.80 rows=5,680 width=54) (actual time=2.881..2.881 rows=5,680 loops=1)

  • Output: contract_family.contract_title, contract_family.contract_type, contract_family.contract_sequence, contract_family.contract_family_id
  • Buckets: 8192 Batches: 1 Memory Usage: 550kB
  • Buffers: shared hit=231
79. 1.584 1.584 ↑ 1.0 5,680 1

Seq Scan on client_pinnacle.contract_family (cost=0.00..287.80 rows=5,680 width=54) (actual time=0.016..1.584 rows=5,680 loops=1)

  • Output: contract_family.contract_title, contract_family.contract_type, contract_family.contract_sequence, contract_family.contract_family_id
  • Buffers: shared hit=231
80. 24.328 184.968 ↑ 1.0 1 26,424

Nested Loop (cost=0.84..0.96 rows=1 width=58) (actual time=0.006..0.007 rows=1 loops=26,424)

  • Output: pro_1.product_id, suomc_1.rate, suomc_1.uom_type_id, tuomc_1.rate, tuomc_1.uom_type_id
  • Join Filter: (claim_product.uom_type_id = tuomc_1.uom_type_id)
  • Rows Removed by Join Filter: 0
  • Buffers: shared hit=214537
81. 0.000 105.696 ↑ 1.0 1 26,424

Nested Loop (cost=0.56..0.63 rows=1 width=53) (actual time=0.004..0.004 rows=1 loops=26,424)

  • Output: pro_1.product_id, suomc_1.rate, suomc_1.product_id, suomc_1.uom_type_id
  • Buffers: shared hit=132121
82. 52.848 52.848 ↑ 1.0 1 26,424

Index Only Scan using product_pkey on client_pinnacle.product pro_1 (cost=0.28..0.30 rows=1 width=16) (actual time=0.001..0.002 rows=1 loops=26,424)

  • Output: pro_1.product_id
  • Index Cond: (pro_1.product_id = claim_product.product_id)
  • Heap Fetches: 0
  • Buffers: shared hit=52849
83. 52.848 52.848 ↑ 1.0 1 26,424

Index Scan using product_uom_conversion_pkey on client_pinnacle.product_uom_conversion suomc_1 (cost=0.28..0.32 rows=1 width=37) (actual time=0.001..0.002 rows=1 loops=26,424)

  • Output: suomc_1.product_id, suomc_1.uom_type_id, suomc_1.rate
  • Index Cond: (suomc_1.product_id = pro_1.product_id)
  • Buffers: shared hit=79272
84. 54.944 54.944 ↑ 1.0 1 27,472

Index Scan using product_uom_conversion_pkey on client_pinnacle.product_uom_conversion tuomc_1 (cost=0.28..0.32 rows=1 width=37) (actual time=0.001..0.002 rows=1 loops=27,472)

  • Output: tuomc_1.product_id, tuomc_1.uom_type_id, tuomc_1.rate
  • Index Cond: (tuomc_1.product_id = pro_1.product_id)
  • Buffers: shared hit=82416
85. 6.223 15.108 ↓ 264.2 26,424 1

Hash (cost=5.44..5.44 rows=100 width=40) (actual time=15.108..15.108 rows=26,424 loops=1)

  • Output: claim_product_order.claim_id, cpo.display_order, cpo.claim_product_id
  • Buckets: 32768 (originally 1024) Batches: 1 (originally 1) Memory Usage: 2114kB
  • Buffers: shared hit=61
86. 3.849 8.885 ↓ 264.2 26,424 1

Nested Loop (cost=0.42..5.44 rows=100 width=40) (actual time=2.196..8.885 rows=26,424 loops=1)

  • Output: claim_product_order.claim_id, cpo.display_order, cpo.claim_product_id
  • Buffers: shared hit=61
87. 0.015 0.015 ↑ 1.0 1 1

Index Scan using claim_product_order_pkey on client_pinnacle.claim_product_order (cost=0.42..3.44 rows=1 width=144) (actual time=0.009..0.015 rows=1 loops=1)

  • Output: claim_product_order.claim_id, claim_product_order.item_ids
  • Index Cond: (claim_product_order.claim_id = '2c3c9316-267c-4439-b4d6-e0f137e32fdf'::uuid)
  • Buffers: shared hit=4
88. 5.021 5.021 ↓ 264.2 26,424 1

Function Scan on pg_catalog.unnest cpo (cost=0.00..1.00 rows=100 width=24) (actual time=2.183..5.021 rows=26,424 loops=1)

  • Output: cpo.claim_product_id, cpo.display_order
  • Function Call: unnest(claim_product_order.item_ids)
  • Buffers: shared hit=57
89. 26.424 211.392 ↑ 1.0 1 26,424

Nested Loop (cost=0.84..1.14 rows=1 width=20) (actual time=0.008..0.008 rows=1 loops=26,424)

  • Output: c.contract_family_id, ct.internal_company_type
  • Inner Unique: true
  • Buffers: shared hit=211392
90. 26.424 158.544 ↑ 1.0 1 26,424

Nested Loop Left Join (cost=0.71..0.92 rows=1 width=48) (actual time=0.006..0.006 rows=1 loops=26,424)

  • Output: c.contract_family_id, gc.company_type_id, cmp.company_type_id
  • Inner Unique: true
  • Buffers: shared hit=158544
91. 26.424 79.272 ↑ 1.0 1 26,424

Nested Loop Left Join (cost=0.42..0.54 rows=1 width=48) (actual time=0.003..0.003 rows=1 loops=26,424)

  • Output: c.contractee_company_id, c.contract_family_id, gc.company_type_id
  • Inner Unique: true
  • Buffers: shared hit=79272
92. 52.848 52.848 ↑ 1.0 1 26,424

Index Scan using contract_family_pkey on client_pinnacle.contract_family c (cost=0.28..0.38 rows=1 width=48) (actual time=0.002..0.002 rows=1 loops=26,424)

  • Output: c.contract_family_id, c.client_id, c.contractee_company_id, c.contractee_grouping_id, c.creator_id, c.contract_sequence, c.cost_basis_type, c.contract_type, c.contract_title, c.contract_template_id, c.payment_calendar_id, c.catch_all, c.import_contract_number, c.accrual_quantity_source
  • Index Cond: (contract_family.contract_family_id = c.contract_family_id)
  • Buffers: shared hit=79272
93. 0.000 0.000 ↓ 0.0 0 26,424

Index Scan using grouping_company_pkey on client_pinnacle.grouping_company gc (cost=0.14..0.16 rows=1 width=32) (actual time=0.000..0.000 rows=0 loops=26,424)

  • Output: gc.grouping_id, gc.client_id, gc.grouping_description, gc.grouping_cd, gc.grouping_type, gc.parent_grouping_id, gc.active_ind, gc.company_type_id, gc.grouping_company_type
  • Index Cond: (gc.grouping_id = c.contractee_grouping_id)
94. 52.848 52.848 ↑ 1.0 1 26,424

Index Scan using company_pkey on client_pinnacle.company cmp (cost=0.29..0.38 rows=1 width=32) (actual time=0.002..0.002 rows=1 loops=26,424)

  • Output: cmp.company_id, cmp.client_id, cmp.company_name, cmp.company_number, cmp.company_type_id, cmp.active_ind, cmp.address_1, cmp.address_2, cmp.address_3, cmp.address_4, cmp.city, cmp.region, cmp.postal_code, cmp.country, cmp.company_agg_id, cmp.deduction_interval, cmp.alt_address_active, cmp.alt_address_1, cmp.alt_address_2, cmp.alt_address_3, cmp.alt_address_4, cmp.alt_city, cmp.alt_region, cmp.alt_postal_code, cmp.alt_country, cmp.atlas_company_id, cmp.email, cmp.tax_type_id, cmp.redistributor_ind, cmp.operator_request, cmp.early_payment_discount, cmp.vip
  • Index Cond: (cmp.company_id = c.contractee_company_id)
  • Buffers: shared hit=79272
95. 26.424 26.424 ↑ 1.0 1 26,424

Index Scan using company_type_pkey on client_pinnacle.company_type ct (cost=0.13..0.19 rows=1 width=20) (actual time=0.001..0.001 rows=1 loops=26,424)

  • Output: ct.company_type_id, ct.client_id, ct.company_type_description, ct.company_type_cd, ct.active_ind, ct.internal_company_type
  • Index Cond: (ct.company_type_id = COALESCE(cmp.company_type_id, gc.company_type_id))
  • Buffers: shared hit=52848
96. 26.424 26.424 ↑ 1.0 1 26,424

Result (cost=0.00..0.04 rows=1 width=24) (actual time=0.001..0.001 rows=1 loops=26,424)

  • Output: NULL::uuid, (CASE WHEN (contract_family.contract_type = ANY ('{GROWTH_AUTOPAY,GROWTH_STANDARD}'::enum.contract_type[])) THEN 'GROWTH'::text WHEN ((contract_family.contract_type <> ALL ('{GROWTH_AUTOPAY,GROWTH_STANDARD}'::enum.contract_type[])) AND (ct.internal_company_type = 'LOCATION'::enum.internal_company_type) AND (claimant_company_type.internal_company_type = 'LOCATION'::enum.internal_company_type)) THEN 'DIRECT'::text WHEN ((contract_family.contract_type <> ALL ('{GROWTH_AUTOPAY,GROWTH_STANDARD}'::enum.contract_type[])) AND (ct.internal_company_type = 'LOCATION'::enum.internal_company_type) AND (claimant_company_type.internal_company_type = 'DISTRIBUTOR'::enum.internal_company_type)) THEN 'DEVIATED'::text WHEN ((contract_family.contract_type <> ALL ('{GROWTH_AUTOPAY,GROWTH_STANDARD}'::enum.contract_type[])) AND (ct.internal_company_type = 'DISTRIBUTOR'::enum.internal_company_type) AND (claimant_company_type.internal_company_type = 'DISTRIBUTOR'::enum.internal_company_type)) THEN 'DIRECT'::text ELSE NULL::text END)::enum.contract_rebate_method, NULL::enum.claim_product_contract_eligibility_type
97. 6.921 170.667 ↓ 1.5 26,424 1

Hash (cost=77,713.62..77,713.62 rows=18,056 width=64) (actual time=170.667..170.667 rows=26,424 loops=1)

  • Output: cpl.distributor_invoice_number, cpl.claim_product_id, cpl.claim_id
  • Buckets: 32768 Batches: 1 Memory Usage: 1934kB
  • Buffers: shared hit=127057
98. 3.811 163.746 ↓ 1.5 26,424 1

Subquery Scan on cpl (cost=77,126.80..77,713.62 rows=18,056 width=64) (actual time=145.479..163.746 rows=26,424 loops=1)

  • Output: cpl.distributor_invoice_number, cpl.claim_product_id, cpl.claim_id
  • Buffers: shared hit=127057
99. 12.421 159.935 ↓ 1.5 26,424 1

GroupAggregate (cost=77,126.80..77,533.06 rows=18,056 width=64) (actual time=145.478..159.935 rows=26,424 loops=1)

  • Output: claim_product_3.claim_id, claim_product_location.claim_product_id, string_agg(claim_product_location.distributor_invoice_number, ', '::text)
  • Group Key: claim_product_3.claim_id, claim_product_location.claim_product_id
  • Buffers: shared hit=127057
100. 12.869 147.514 ↓ 1.5 26,424 1

Sort (cost=77,126.80..77,171.94 rows=18,056 width=33) (actual time=145.466..147.514 rows=26,424 loops=1)

  • Output: claim_product_3.claim_id, claim_product_location.claim_product_id, claim_product_location.distributor_invoice_number
  • Sort Key: claim_product_location.claim_product_id
  • Sort Method: quicksort Memory: 2833kB
  • Buffers: shared hit=127057
101. 10.992 134.645 ↓ 1.5 26,424 1

Nested Loop (cost=389.90..75,850.22 rows=18,056 width=33) (actual time=7.328..134.645 rows=26,424 loops=1)

  • Output: claim_product_3.claim_id, claim_product_location.claim_product_id, claim_product_location.distributor_invoice_number
  • Buffers: shared hit=127057
102. 40.772 44.381 ↑ 1.0 26,424 1

Bitmap Heap Scan on client_pinnacle.claim_product claim_product_3 (cost=389.34..31,681.35 rows=27,537 width=32) (actual time=7.302..44.381 rows=26,424 loops=1)

  • Output: claim_product_3.claim_id, claim_product_3.claim_product_id
  • Recheck Cond: (claim_product_3.claim_id = '2c3c9316-267c-4439-b4d6-e0f137e32fdf'::uuid)
  • Heap Blocks: exact=20870
  • Buffers: shared hit=20975
103. 3.609 3.609 ↑ 1.0 26,424 1

Bitmap Index Scan on claim_product_claim_id_idx (cost=0.00..382.46 rows=27,537 width=0) (actual time=3.609..3.609 rows=26,424 loops=1)

  • Index Cond: (claim_product_3.claim_id = '2c3c9316-267c-4439-b4d6-e0f137e32fdf'::uuid)
  • Buffers: shared hit=105
104. 79.272 79.272 ↑ 5.0 1 26,424

Index Only Scan using claim_product_location_pkey on client_pinnacle.claim_product_location (cost=0.56..1.55 rows=5 width=17) (actual time=0.003..0.003 rows=1 loops=26,424)

  • Output: claim_product_location.claim_product_id, claim_product_location.location_id, claim_product_location.distributor_invoice_number
  • Index Cond: (claim_product_location.claim_product_id = claim_product_3.claim_product_id)
  • Heap Fetches: 0
  • Buffers: shared hit=106082