explain.depesz.com

PostgreSQL's explain analyze made readable

Result: lIxd

Settings
# exclusive inclusive rows x rows loops node
1. 0.000 0.000 ↓ 0.0

Unique (cost=2,462,436,283.68..2,469,748,297.68 rows=20,311,150 width=3,537) (actual rows= loops=)

  • "*SELECT* 1".li_adjustment_total_base, "*SELECT* 1".li_adjustment_unit, "*SELECT* 1".li_item_quantity, (("*SELECT* 1".li_item_unit_cost)::double precision), (("*SELECT* 1".li_line_item_total_submitted)::double precision), "*SELECT* 1".li_discount_submitted, "*SELECT* 1".li_discount_base, (("*SELECT* 1".li_line_item_total_base)::double precision), "*SELECT* 1".li_timekeeper_rate_submitted, "*SELECT* 1".li_timekeeper_rate_base, "*SELECT* 1".tk_time_keeper_id, "*SELECT* 1".tk_currency_code, "*SELECT* 1".tk_currency_symbol, (("*SELECT* 1".tk_date_bar_passed)::numeric), "*SELECT* 1".tk_default_rate_effective_date, "*SELECT* 1".tk_email, "*SELECT* 1".tk_employee_id, "*SELECT* 1".tk_ethnicity, (("*SELECT* 1".tk_first_practiced)::numeric), "*SELECT* 1".tk_full_name, "*SELECT* 1".tk_gender, "*SELECT* 1".tk_default_rate, "*SELECT* 1".tk_initials, (("*SELECT* 1".tk_lawyer)::numeric), "*SELECT* 1".tk_other_ethnicity, "*SELECT* 1".tk_phone, "*SELECT* 1".tk_staff_class_code, "*SELECT* 1".tk_staff_class_description, "*SELECT* 1".tk_url, "*SELECT* 1".tk_approved_rate, "*SELECT* 1".tk_pending_rate, "*SELECT* 1".tk_client_time_keeper_id, "*SELECT* 1".tk_office_id, "*SELECT* 1".tk_office_name, "*SELECT* 1".bp_tk_client_approved_rate, "*SELECT* 1".bp_tk_standard_rate, "*SELECT* 1".client_base_currency_code, "*SELECT* 1".client_base_currency_symbol, "*SELECT* 1".tk_country, "*SELECT* 1".tk_time_keeper_id_text, "*SELECT* 1".inv_vat_processing, "*SELECT* 1".li_optional_tax_rate
2.          

CTE bp_accounts

3. 0.000 0.000 ↓ 0.0

Hash Join (cost=542.56..562.96 rows=8 width=80) (actual rows= loops=)

  • Hash Cond: (currencies.id = master_accounts.currency_id)
4. 0.000 0.000 ↓ 0.0

Seq Scan on bp_currencies currencies (cost=0.00..17.50 rows=750 width=80) (actual rows= loops=)

5. 0.000 0.000 ↓ 0.0

Hash (cost=542.54..542.54 rows=2 width=32) (actual rows= loops=)

6. 0.000 0.000 ↓ 0.0

Append (cost=100.00..542.54 rows=2 width=32) (actual rows= loops=)

7. 0.000 0.000 ↓ 0.0

Foreign Scan on master_accounts (cost=100.00..531.79 rows=1 width=32) (actual rows= loops=)

8. 0.000 0.000 ↓ 0.0

Seq Scan on private_accounts (cost=0.00..10.75 rows=1 width=32) (actual rows= loops=)

  • Filter: ((subdomain)::text = 'metlife-leg'::text)
9. 0.000 0.000 ↓ 0.0

Sort (cost=2,462,435,720.72..2,462,486,498.59 rows=20,311,150 width=3,537) (actual rows= loops=)

  • Sort Key: "*SELECT* 1".client_project_number, "*SELECT* 1".account_id, "*SELECT* 1".client_account_id, "*SELECT* 1".vendor_end_date, "*SELECT* 1".vendor_id, "*SELECT* 1".vendor_fee_arrangement_name, "*SELECT* 1".vendor_modification_reason, "*SELECT* 1".vendor_purchase_order_number, "*SELECT* 1".vendor_start_date, "*SELECT* 1".vendor_state, "*SELECT* 1".vendor_budget_amount_submitted, "*SELECT* 1".vendor_budget_amount_base, "*SELECT* 1".vendor_client_spot_rate, "*SELECT* 1".vendor_currency_code, "*SELECT* 1".vendor_currency_symbol, (("*SELECT* 1".vendor_edited_since_disputed)::numeric), "*SELECT* 1".inv_id, "*SELECT* 1".inv_adjustments_enabled, "*SELECT* 1".inv_ap_details, "*SELECT* 1".inv_approved_date, "*SELECT* 1".inv_billing_end_date, "*SELECT* 1".inv_billing_start_date, (("*SELECT* 1".inv_client_spot_rate)::double precision), "*SELECT* 1".inv_invoice_date, "*SELECT* 1".inv_invoice_number, "*SELECT* 1".inv_notes, "*SELECT* 1".inv_po_number, "*SELECT* 1".inv_received_date, "*SELECT* 1".inv_resubmitted, "*SELECT* 1".inv_state, "*SELECT* 1".inv_submission_type, "*SELECT* 1".inv_dispute_adjustment_total_submitted, "*SELECT* 1".inv_dispute_adjustment_total_base, (("*SELECT* 1".inv_expense_discount_submitted)::double precision), (("*SELECT* 1".inv_expense_discount_base)::double precision), "*SELECT* 1".inv_expense_header_dispute_adjustment_submitted, "*SELECT* 1".inv_expense_header_dispute_adjustment_base, "*SELECT* 1".inv_expense_line_item_dispute_adjustment_submitted, "*SELECT* 1".inv_expense_line_item_dispute_adjustment_base, (("*SELECT* 1".inv_fee_discount_submitted)::double precision), (("*SELECT* 1".inv_fee_discount_base)::double precision), "*SELECT* 1".inv_fee_header_dispute_adjustment_submitted, "*SELECT* 1".inv_fee_header_dispute_adjustment_base, "*SELECT* 1".inv_fee_line_item_dispute_adjustment_submitted, "*SELECT* 1".inv_fee_line_item_dispute_adjustment_base, "*SELECT* 1".inv_header_dispute_adjustment_submitted, "*SELECT* 1".inv_header_dispute_adjustment_base, "*SELECT* 1".inv_header_short_pay_adjustment_submitted, "*SELECT* 1".inv_header_short_pay_adjustment_base, (("*SELECT* 1".inv_invoice_fees_submitted)::double precision), (("*SELECT* 1".inv_invoice_fees_base)::double precision), (("*SELECT* 1".inv_invoice_expenses_submitted)::double precision), (("*SELECT* 1".inv_invoice_expenses_base)::double precision), (("*SELECT* 1".inv_invoice_orig_amount_submitted)::double precision), (("*SELECT* 1".inv_invoice_orig_amount_base)::double precision), (("*SELECT* 1".inv_invoice_orig_discount_submitted)::double precision), (("*SELECT* 1".inv_invoice_orig_discount_base)::double precision), (("*SELECT* 1".inv_invoice_orig_expenses_submitted)::double precision), (("*SELECT* 1".inv_invoice_orig_expenses_base)::double precision), (("*SELECT* 1".inv_invoice_orig_fees_submitted)::double precision), (("*SELECT* 1".inv_invoice_orig_fees_base)::double precision), (("*SELECT* 1".inv_invoice_total_submitted)::double precision), (("*SELECT* 1".inv_invoice_total_base)::double precision), "*SELECT* 1".inv_line_item_short_pay_adjustment_submitted, "*SELECT* 1".inv_line_item_short_pay_adjustment_base, (("*SELECT* 1".inv_orig_expense_discount_submitted)::double precision), (("*SELECT* 1".inv_orig_expense_discount_base)::double precision), (("*SELECT* 1".inv_orig_fee_discount_submitted)::double precision), (("*SELECT* 1".inv_orig_fee_discount_base)::double precision), (("*SELECT* 1".inv_pay_total_submitted)::double precision), (("*SELECT* 1".inv_pay_total_base)::double precision), "*SELECT* 1".inv_short_pay_adjustment_total_submitted, "*SELECT* 1".inv_short_pay_adjustment_total_base, "*SELECT* 1".inv_remote_key, "*SELECT* 1".li_task_description, "*SELECT* 1".li_tax_description, "*SELECT* 1".li_expense_description, "*SELECT* 1".li_discount_description, "*SELECT* 1".li_activity_description, "*SELECT* 1".li_adjustment_description, "*SELECT* 1".li_id, "*SELECT* 1".li_activity_code, (("*SELECT* 1".li_activity_date)::timestamp without time zone), "*SELECT* 1".li_adjuster_id, "*SELECT* 1".li_adjuster_name, "*SELECT* 1".li_adjustment_code, "*SELECT* 1".li_adjustment_value, "*SELECT* 1".li_discount_code, "*SELECT* 1".li_dispute_adjustment_type, "*SELECT* 1".li_expense_code, (("*SELECT* 1".li_inactive)::numeric), "*SELECT* 1".li_invoice_line_item_type, "*SELECT* 1".li_item_description, "*SELECT* 1".li_parent_type, "*SELECT* 1".li_parent_id, (("*SELECT* 1".li_system_created)::numeric), "*SELECT* 1".li_task_code, "*SELECT* 1".li_tax_code, "*SELECT* 1".li_adjustment_cost_submitted, "*SELECT* 1".li_adjustment_cost_base, "*SELECT* 1".li_adjustment_total_submitted,
10. 0.000 0.000 ↓ 0.0

Append (cost=8,404,518.66..2,336,119,964.83 rows=20,311,150 width=3,537) (actual rows= loops=)

11. 0.000 0.000 ↓ 0.0

Subquery Scan on *SELECT* 1 (cost=8,404,518.66..2,336,119,744.36 rows=20,310,652 width=2,927) (actual rows= loops=)

12. 0.000 0.000 ↓ 0.0

Hash Left Join (cost=8,404,518.66..2,334,139,455.79 rows=20,310,652 width=3,056) (actual rows= loops=)

  • Hash Cond: (li.time_keeper_id = tk.time_keeper_id)
13. 0.000 0.000 ↓ 0.0

Hash Join (cost=8,403,728.62..9,307,439.93 rows=686,983 width=1,409) (actual rows= loops=)

  • Hash Cond: (li.invoice_id = invoices.id)
14. 0.000 0.000 ↓ 0.0

Subquery Scan on li (cost=8,383,926.50..8,710,975.28 rows=2,669,786 width=826) (actual rows= loops=)

15. 0.000 0.000 ↓ 0.0

Unique (cost=8,383,926.50..8,684,277.42 rows=2,669,786 width=954) (actual rows= loops=)

16.          

CTE bp_accounts

17. 0.000 0.000 ↓ 0.0

Hash Join (cost=542.56..562.96 rows=8 width=16) (actual rows= loops=)

  • Hash Cond: (currencies_1.id = master_accounts_1.currency_id)
18. 0.000 0.000 ↓ 0.0

Seq Scan on bp_currencies currencies_1 (cost=0.00..17.50 rows=750 width=16) (actual rows= loops=)

19. 0.000 0.000 ↓ 0.0

Hash (cost=542.54..542.54 rows=2 width=32) (actual rows= loops=)

20. 0.000 0.000 ↓ 0.0

Append (cost=100.00..542.54 rows=2 width=32) (actual rows= loops=)

21. 0.000 0.000 ↓ 0.0

Foreign Scan on master_accounts master_accounts_1 (cost=100.00..531.79 rows=1 width=32) (actual rows= loops=)

22. 0.000 0.000 ↓ 0.0

Seq Scan on private_accounts private_accounts_1 (cost=0.00..10.75 rows=1 width=32) (actual rows= loops=)

  • Filter: ((subdomain)::text = 'metlife-leg'::text)
23.          

CTE bp_users

24. 0.000 0.000 ↓ 0.0

Foreign Scan on users (cost=100.00..89,595.84 rows=83,828 width=48) (actual rows= loops=)

25.          

CTE act_codes

26. 0.000 0.000 ↓ 0.0

Hash Left Join (cost=217.04..243.17 rows=575 width=112) (actual rows= loops=)

  • Hash Cond: (("*SELECT* 1_1".code)::text = ("*SELECT* 1_2".code)::text)
  • Join Filter: ("*SELECT* 1_1".client_account_id IS NOT NULL)
27. 0.000 0.000 ↓ 0.0

Append (cost=100.00..120.90 rows=575 width=80) (actual rows= loops=)

28. 0.000 0.000 ↓ 0.0

Subquery Scan on *SELECT* 1_1 (cost=100.00..106.20 rows=105 width=80) (actual rows= loops=)

29. 0.000 0.000 ↓ 0.0

Foreign Scan on master_activity_codes (cost=100.00..105.15 rows=105 width=144) (actual rows= loops=)

30. 0.000 0.000 ↓ 0.0

Seq Scan on private_activity_codes (cost=0.00..14.70 rows=470 width=80) (actual rows= loops=)

31. 0.000 0.000 ↓ 0.0

Hash (cost=115.70..115.70 rows=107 width=64) (actual rows= loops=)

32. 0.000 0.000 ↓ 0.0

Append (cost=100.00..115.70 rows=107 width=64) (actual rows= loops=)

33. 0.000 0.000 ↓ 0.0

Subquery Scan on *SELECT* 1_2 (cost=100.00..106.20 rows=105 width=64) (actual rows= loops=)

34. 0.000 0.000 ↓ 0.0

Foreign Scan on master_activity_codes master_activity_codes_1 (cost=100.00..105.15 rows=105 width=144) (actual rows= loops=)

35. 0.000 0.000 ↓ 0.0

Bitmap Heap Scan on private_activity_codes private_activity_codes_1 (cost=4.16..9.50 rows=2 width=64) (actual rows= loops=)

  • Recheck Cond: (client_account_id IS NULL)
36. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on index_activity_codes_on_client_account_id (cost=0.00..4.16 rows=2 width=0) (actual rows= loops=)

  • Index Cond: (client_account_id IS NULL)
37.          

CTE adjust_codes

38. 0.000 0.000 ↓ 0.0

Hash Left Join (cost=203.12..206.28 rows=22 width=113) (actual rows= loops=)

  • Hash Cond: (("*SELECT* 1_3".code)::text = ("*SELECT* 1_4&quo...