explain.depesz.com

PostgreSQL's explain analyze made readable

Result: t5ol

Settings
# exclusive inclusive rows x rows loops node
1. 5.481 38,233.058 ↓ 200.0 200 1

Limit (cost=1,429,548.77..1,429,548.77 rows=1 width=9,660) (actual time=38,232.862..38,233.058 rows=200 loops=1)

2. 588.142 38,227.577 ↓ 89.6 30,200 1

Sort (cost=1,429,547.93..1,429,548.77 rows=337 width=9,660) (actual time=38,196.099..38,227.577 rows=30,200 loops=1)

  • Sort Key: tx.updated_at, tx.id DESC
  • Sort Method: external merge Disk: 120024kB
3. 76.901 37,639.435 ↓ 190.8 64,283 1

Nested Loop Left Join (cost=1,408,794.98..1,429,533.78 rows=337 width=9,660) (actual time=4,646.065..37,639.435 rows=64,283 loops=1)

4. 14,376.137 37,176.836 ↓ 190.8 64,283 1

Nested Loop Left Join (cost=1,408,794.69..1,427,755.63 rows=337 width=9,645) (actual time=4,646.051..37,176.836 rows=64,283 loops=1)

  • Join Filter: ((tx.id)::text = (external_expense.transaction_id)::text)
  • Rows Removed by Join Filter: 52583494
5. 1,342.859 12,194.004 ↓ 190.8 64,283 1

Nested Loop Left Join (cost=1,408,794.69..1,423,593.41 rows=337 width=9,625) (actual time=4,645.218..12,194.004 rows=64,283 loops=1)

  • Join Filter: (tx.cost_center_id = cc.id)
  • Rows Removed by Join Filter: 4822817
6. 101.467 8,665.523 ↓ 190.8 64,283 1

Nested Loop Left Join (cost=1,408,794.40..1,422,768.09 rows=337 width=9,608) (actual time=4,645.153..8,665.523 rows=64,283 loops=1)

7. 84.786 8,114.075 ↓ 190.8 64,283 1

Nested Loop Left Join (cost=1,408,794.12..1,422,656.19 rows=337 width=9,579) (actual time=4,645.134..8,114.075 rows=64,283 loops=1)

8. 113.042 7,643.591 ↓ 190.8 64,283 1

Nested Loop Left Join (cost=1,408,793.84..1,422,550.67 rows=337 width=9,579) (actual time=4,645.113..7,643.591 rows=64,283 loops=1)

9. 103.828 6,887.719 ↓ 190.8 64,283 1

Nested Loop Left Join (cost=1,408,793.42..1,419,803.02 rows=337 width=9,518) (actual time=4,645.093..6,887.719 rows=64,283 loops=1)

10. 77.349 6,783.891 ↓ 190.8 64,283 1

Nested Loop Left Join (cost=1,408,793.13..1,417,492.86 rows=337 width=9,476) (actual time=4,645.088..6,783.891 rows=64,283 loops=1)

11. 79.355 6,577.976 ↓ 190.8 64,283 1

Nested Loop Left Join (cost=1,408,792.71..1,414,769.21 rows=337 width=9,458) (actual time=4,645.084..6,577.976 rows=64,283 loops=1)

12. 99.183 5,855.791 ↓ 190.8 64,283 1

Nested Loop (cost=1,408,792.29..1,412,042.40 rows=337 width=9,421) (actual time=4,645.064..5,855.791 rows=64,283 loops=1)

13. 139.078 5,563.759 ↓ 190.8 64,283 1

Nested Loop (cost=1,408,791.86..1,409,277.91 rows=337 width=9,389) (actual time=4,645.052..5,563.759 rows=64,283 loops=1)

14. 157.959 4,910.417 ↓ 190.8 64,283 1

Merge Join (cost=1,408,791.45..1,408,987.36 rows=337 width=9,343) (actual time=4,645.022..4,910.417 rows=64,283 loops=1)

  • Merge Cond: ((ou.org_id)::text = (o.id)::text)
15. 359.307 4,576.060 ↓ 190.8 64,283 1

Sort (cost=1,404,001.97..1,404,002.82 rows=337 width=9,319) (actual time=4,485.858..4,576.060 rows=64,283 loops=1)

  • Sort Key: ou.org_id
  • Sort Method: external sort Disk: 105904kB
16. 113.268 4,216.753 ↓ 190.8 64,283 1

Nested Loop (cost=1,401,240.53..1,403,987.82 rows=337 width=9,319) (actual time=3,367.549..4,216.753 rows=64,283 loops=1)

17. 97.549 3,653.504 ↓ 190.8 64,283 1

Unique (cost=1,401,240.11..1,401,366.49 rows=337 width=5,038) (actual time=3,367.509..3,653.504 rows=64,283 loops=1)

18. 607.757 3,555.955 ↓ 190.8 64,283 1

Sort (cost=1,401,240.11..1,401,240.96 rows=337 width=5,038) (actual time=3,367.506..3,555.955 rows=64,283 loops=1)

  • Sort Key: tx.id, tx.org_user_id, tx.txn_dt, tx.created_at, tx.category, tx.amount, tx.currency, tx.report_id, tx.status_id, tx.tax, tx.state, tx.updated_at, tx.source, tx.num_files, tx.invoice_number, tx.purpose, tx.vendor_id, tx.project_id, tx.billable, tx.skip_reimbursement, tx.orig_amount, tx.orig_currency, tx.creator_id, tx.custom_attributes, tx.cost_center_id, tx.external_id, tx.platform_vendor_id, tx.verification_state, tx.payment_id, tx.source_account_id, tx.last_updated_by, tx.transcription_state, tx.physical_bill, tx.org_category_id, tx.user_amount, tx.policy_amount, tx.admin_amount, tx.policy_state, tx.manual_flag, tx.policy_flag, tx.expense_number, tx.extracted_data, tx.split_group_id, tx.split_group_user_amount, tx.location1, tx.location2, tx.location3, tx.location4, tx.location5, tx.location6, tx.location7, tx.location8, tx.location9, tx.location10, tx.distance, tx.distance_unit, tx.from_dt, tx.to_dt, tx.num_days, tx.mileage_calculated_distance, tx.mileage_calculated_amount, tx.mileage_vehicle_type, tx.mileage_rate, tx.mileage_is_round_trip, tx.hotel_is_breakfast_provided, tx.flight_journey_travel_class, tx.flight_return_travel_class, tx.train_travel_class, tx.bus_travel_class, tx.per_diem_rate_id, tx.activity_policy_pending, tx.activity_details, tx.text_column1, tx.text_column2, tx.text_column3, tx.text_column4, tx.text_column5, tx.text_column6, tx.text_column7, tx.text_column8, tx.text_column9, tx.text_column10, tx.text_column11, tx.text_column12, tx.text_column13, tx.text_column14, tx.text_column15, tx.text_array_column1, tx.text_array_column2, tx.text_array_column3, tx.text_array_column4, tx.text_array_column5, tx.text_array_column6, tx.text_array_column7, tx.text_array_column8, tx.text_array_column9, tx.text_array_column10, tx.decimal_column1, tx.decimal_column2, tx.decimal_column3, tx.decimal_column4, tx.decimal_column5, tx.decimal_column6, tx.decimal_column7, tx.decimal_column8, tx.decimal_column9, tx.decimal_column10, tx.location_column1, tx.location_column2, tx.location_column3, tx.location_column4, tx.location_column5, tx.location_column6, tx.location_column7, tx.location_column8, tx.location_column9, tx.location_column10, tx.boolean_column1, tx.boolean_column2, tx.boolean_column3, tx.boolean_column4, tx.boolean_column5, tx.boolean_column6, tx.boolean_column7, tx.boolean_column8, tx.boolean_column9, tx.boolean_column10, tx.timestamp_column1, tx.timestamp_column2, tx.timestamp_column3, tx.timestamp_column4, tx.timestamp_column5, tx.timestamp_column6, tx.timestamp_column7, tx.timestamp_column8, tx.timestamp_column9, tx.timestamp_column10, tx.fyle_category, tx.proposed_exchange_rate, tx.exchange_rate, tx.exchange_rate_diff_percentage, tx.custom_properties, tx.physical_bill_at, tx.transcribed_data, tx.user_review_needed, tx.mandatory_fields_present, tx.user_can_delete, tx.user_reason_for_duplicate_expenses, ((SubPlan 15))
  • Sort Method: external merge Disk: 99648kB
19. 26.103 2,948.198 ↓ 190.8 64,283 1

Append (cost=3,105.42..1,401,225.97 rows=337 width=5,038) (actual time=2,859.994..2,948.198 rows=64,283 loops=1)

20. 0.003 3.938 ↓ 0.0 0 1

Sort (cost=3,105.42..3,105.43 rows=1 width=5,038) (actual time=3.938..3.938 rows=0 loops=1)

  • Sort Key: tx.created_at
  • Sort Method: quicksort Memory: 25kB
21. 0.686 3.935 ↓ 0.0 0 1

Index Scan using idx_transactions_org_user_id on transactions tx (cost=0.43..3,105.41 rows=1 width=5,038) (actual time=3.935..3.935 rows=0 loops=1)

  • Index Cond: ((org_user_id)::text = 'oukRlv4I8fk3'::text)
  • Filter: ((SubPlan 16) @> '{oukRlv4I8fk3}'::character varying[])
  • Rows Removed by Filter: 361
22.          

SubPlan (for Index Scan)

23. 0.000 0.000 ↓ 0.0 0

Aggregate (cost=12.46..12.47 rows=1 width=13) (never executed)

24. 0.000 0.000 ↓ 0.0 0

Index Scan using idx_report_approvals_report_id on report_approvals ra_14 (cost=0.42..12.46 rows=2 width=13) (never executed)

  • Index Cond: ((report_id)::text = (tx.report_id)::text)
25. 0.361 3.249 ↑ 1.0 1 361

Aggregate (cost=12.46..12.47 rows=1 width=13) (actual time=0.009..0.009 rows=1 loops=361)

26. 2.888 2.888 ↑ 2.0 1 361

Index Scan using idx_report_approvals_report_id on report_approvals ra_15 (cost=0.42..12.46 rows=2 width=13) (actual time=0.007..0.008 rows=1 loops=361)

  • Index Cond: ((report_id)::text = (tx.report_id)::text)
27. 0.002 0.021 ↓ 0.0 0 1

Sort (cost=136,776.10..136,776.11 rows=2 width=5,038) (actual time=0.021..0.021 rows=0 loops=1)

  • Sort Key: tx_1.created_at
  • Sort Method: quicksort Memory: 25kB
28. 0.002 0.019 ↓ 0.0 0 1

Nested Loop (cost=9.12..136,776.09 rows=2 width=5,038) (actual time=0.019..0.019 rows=0 loops=1)

29. 0.000 0.017 ↓ 0.0 0 1

Bitmap Heap Scan on projects p (cost=8.69..65.97 rows=15 width=4) (actual time=0.017..0.017 rows=0 loops=1)

  • Recheck Cond: (((approver1_id)::text = 'oukRlv4I8fk3'::text) OR ((approver2_id)::text = 'oukRlv4I8fk3'::text))
30. 0.003 0.017 ↓ 0.0 0 1

BitmapOr (cost=8.69..8.69 rows=15 width=0) (actual time=0.017..0.017 rows=0 loops=1)

31. 0.008 0.008 ↓ 0.0 0 1

Bitmap Index Scan on idx_projects_approver1_id (cost=0.00..4.35 rows=9 width=0) (actual time=0.008..0.008 rows=0 loops=1)

  • Index Cond: ((approver1_id)::text = 'oukRlv4I8fk3'::text)
32. 0.006 0.006 ↓ 0.0 0 1

Bitmap Index Scan on idx_projects_approver2_id (cost=0.00..4.32 rows=5 width=0) (actual time=0.006..0.006 rows=0 loops=1)

  • Index Cond: ((approver2_id)::text = 'oukRlv4I8fk3'::text)
33. 0.000 0.000 ↓ 0.0 0

Index Scan using idx_transactions_project_id on transactions tx_1 (cost=0.43..9,112.32 rows=3 width=5,038) (never executed)

  • Index Cond: (project_id = p.id)
  • Filter: ((SubPlan 14) @> '{oukRlv4I8fk3}'::character varying[])
34.          

SubPlan (for Index Scan)

35. 0.000 0.000 ↓ 0.0 0

Aggregate (cost=12.46..12.47 rows=1 width=13) (never executed)

36. 0.000 0.000 ↓ 0.0 0

Index Scan using idx_report_approvals_report_id on report_approvals ra_13 (cost=0.42..12.46 rows=2 width=13) (never executed)

  • Index Cond: ((report_id)::text = (tx_1.report_id)::text)
37.          

SubPlan (for Nested Loop)

38. 0.000 0.000 ↓ 0.0 0

Aggregate (cost=12.46..12.47 rows=1 width=13) (never executed)

39. 0.000 0.000 ↓ 0.0 0

Index Scan using idx_report_approvals_report_id on report_approvals ra_12 (cost=0.42..12.46 rows=2 width=13) (never executed)

  • Index Cond: ((report_id)::text = (tx_1.report_id)::text)
40. 0.002 1.148 ↓ 0.0 0 1

Sort (cost=20,934.59..20,934.60 rows=1 width=5,038) (actual time=1.148..1.148 rows=0 loops=1)

  • Sort Key: tx_2.created_at
  • Sort Method: quicksort Memory: 25kB
41. 0.001 1.146 ↓ 0.0 0 1

Nested Loop (cost=5.02..20,934.58 rows=1 width=5,038) (actual time=1.146..1.146 rows=0 loops=1)

42. 0.000 1.145 ↓ 0.0 0 1

Nested Loop (cost=4.59..623.18 rows=8 width=13) (actual time=1.145..1.145 rows=0 loops=1)

43. 1.145 1.145 ↓ 0.0 0 1

Seq Scan on departments d (cost=0.00..533.29 rows=1 width=15) (actual time=1.145..1.145 rows=0 loops=1)

  • Filter: ((department_head_id)::text = 'oukRlv4I8fk3'::text)
  • Rows Removed by Filter: 8759
44. 0.000 0.000 ↓ 0.0 0

Bitmap Heap Scan on org_users ou_1 (cost=4.59..89.67 rows=22 width=28) (never executed)

  • Recheck Cond: ((department_id)::text = (d.id)::text)
45. 0.000 0.000 ↓ 0.0 0

Bitmap Index Scan on idx_org_users_dept_id (cost=0.00..4.58 rows=22 width=0) (never executed)

  • Index Cond: ((department_id)::text = (d.id)::text)
46. 0.000 0.000 ↓ 0.0 0

Index Scan using idx_transactions_org_user_id on transactions tx_2 (cost=0.43..2,537.36 rows=1 width=5,038) (never executed)

  • Index Cond: ((org_user_id)::text = (ou_1.id)::text)
  • Filter: ((SubPlan 12) @> '{oukRlv4I8fk3}'::character varying[])
47.          

SubPlan (for Index Scan)

48. 0.000 0.000 ↓ 0.0 0

Aggregate (cost=12.46..12.47 rows=1 width=13) (never executed)

49. 0.000 0.000 ↓ 0.0 0

Index Scan using idx_report_approvals_report_id on report_approvals ra_11 (cost=0.42..12.46 rows=2 width=13) (never executed)

  • Index Cond: ((report_id)::text = (tx_2.report_id)::text)
50.          

SubPlan (for Nested Loop)

51. 0.000 0.000 ↓ 0.0 0

Aggregate (cost=12.46..12.47 rows=1 width=13) (never executed)

52. 0.000 0.000 ↓ 0.0 0

Index Scan using idx_report_approvals_report_id on report_approvals ra_10 (cost=0.42..12.46 rows=2 width=13) (never executed)

  • Index Cond: ((report_id)::text = (tx_2.report_id)::text)
53. 406.186 2,916.573 ↓ 195.4 64,283 1

Sort (cost=1,238,400.77..1,238,401.60 rows=329 width=5,038) (actual time=2,854.885..2,916.573 rows=64,283 loops=1)

  • Sort Key: tx_3.created_at
  • Sort Method: external merge Disk: 99624kB
54. 204.648 2,510.387 ↓ 195.4 64,283 1

Nested Loop (cost=2,266.96..1,238,387.02 rows=329 width=5,038) (actual time=8.452..2,510.387 rows=64,283 loops=1)

55. 46.991 53.134 ↑ 1.0 64,391 1

Bitmap Heap Scan on transaction_approvals ta (cost=2,266.53..62,341.19 rows=65,819 width=13) (actual time=8.397..53.134 rows=64,391 loops=1)

  • Recheck Cond: ((approver_id)::text = 'oukRlv4I8fk3'::text)
  • Heap Blocks: exact=14395
56. 6.143 6.143 ↑ 1.0 64,391 1

Bitmap Index Scan on idx_transaction_approvals_approver_id (cost=0.00..2,250.07 rows=65,819 width=0) (actual time=6.143..6.143 rows=64,391 loops=1)

  • Index Cond: ((approver_id)::text = 'oukRlv4I8fk3'::text)
57. 901.474 1,609.775 ↑ 1.0 1 64,391

Index Scan using transactions_pkey on transactions tx_3 (cost=0.43..17.80 rows=1 width=5,038) (actual time=0.025..0.025 rows=1 loops=64,391)

  • Index Cond: ((id)::text = (ta.transaction_id)::text)
  • Filter: ((SubPlan 10) @> '{oukRlv4I8fk3}'::character varying[])
  • Rows Removed by Filter: 0
58.          

SubPlan (for Index Scan)

59. 128.782 708.301 ↑ 1.0 1 64,391

Aggregate (cost=12.46..12.47 rows=1 width=13) (actual time=0.011..0.011 rows=1 loops=64,391)

60. 579.519 579.519 ↑ 1.0 2 64,391

Index Scan using idx_report_approvals_report_id on report_approvals ra_9 (cost=0.42..12.46 rows=2 width=13) (actual time=0.008..0.009 rows=2 loops=64,391)

  • Index Cond: ((report_id)::text = (tx_3.report_id)::text)
61.          

SubPlan (for Nested Loop)

62. 128.566 642.830 ↑ 1.0 1 64,283

Aggregate (cost=12.46..12.47 rows=1 width=13) (actual time=0.010..0.010 rows=1 loops=64,283)

63. 514.264 514.264 ↑ 1.0 2 64,283

Index Scan using idx_report_approvals_report_id on report_approvals ra_8 (cost=0.42..12.46 rows=2 width=13) (actual time=0.007..0.008 rows=2 loops=64,283)

  • Index Cond: ((report_id)::text = (tx_3.report_id)::text)
64. 0.013 0.056 ↓ 0.0 0 1

Sort (cost=157.40..157.40 rows=1 width=5,038) (actual time=0.056..0.056 rows=0 loops=1)

  • Sort Key: tx_4.created_at
  • Sort Method: quicksort Memory: 25kB
65. 0.001 0.043 ↓ 0.0 0 1

Nested Loop (cost=19.11..157.39 rows=1 width=5,038) (actual time=0.043..0.043 rows=0 loops=1)

66. 0.000 0.042 ↓ 0.0 0 1

Nested Loop (cost=18.83..144.12 rows=1 width=5,061) (actual time=0.042..0.042 rows=0 loops=1)

67. 0.001 0.042 ↓ 0.0 0 1

Nested Loop (cost=18.40..123.20 rows=1 width=36) (actual time=0.042..0.042 rows=0 loops=1)

68. 0.015 0.041 ↓ 0.0 0 1

Hash Join (cost=18.13..122.88 rows=1 width=34) (actual time=0.041..0.041 rows=0 loops=1)

  • Hash Cond: ((hr.trip_request_id)::text = (tra.trip_request_id)::text)
69. 0.008 0.008 ↑ 1,528.0 1 1

Seq Scan on hotel_requests hr (cost=0.00..93.28 rows=1,528 width=22) (actual time=0.008..0.008 rows=1 loops=1)

70. 0.000 0.018 ↓ 0.0 0 1

Hash (cost=18.08..18.08 rows=4 width=12) (actual time=0.018..0.018 rows=0 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 8kB
71. 0.002 0.018 ↓ 0.0 0 1

Bitmap Heap Scan on trip_request_approvals tra (cost=4.31..18.08 rows=4 width=12) (actual time=0.018..0.018 rows=0 loops=1)

  • Recheck Cond: ((approver_id)::text = 'oukRlv4I8fk3'::text)
72. 0.016 0.016 ↓ 0.0 0 1

Bitmap Index Scan on idx_trip_request_approvals_approver_id (cost=0.00..4.31 rows=4 width=0) (actual time=0.016..0.016 rows=0 loops=1)

  • Index Cond: ((approver_id)::text = 'oukRlv4I8fk3'::text)
73. 0.000 0.000 ↓ 0.0 0

Index Scan using hotel_bookings_pkey on hotel_bookings hb (cost=0.27..0.32 rows=1 width=24) (never executed)

  • Index Cond: ((id)::text = (hr.id)::text)
74. 0.000 0.000 ↓ 0.0 0

Index Scan using transactions_pkey on transactions tx_4 (cost=0.43..20.90 rows=1 width=5,038) (never executed)

  • Index Cond: ((id)::text = (hb.transaction_id)::text)
  • Filter: ((SubPlan 8) @> '{oukRlv4I8fk3}'::character varying[])
75.          

SubPlan (for Index Scan)

76. 0.000 0.000 ↓ 0.0 0

Aggregate (cost=12.46..12.47 rows=1 width=13) (never executed)

77. 0.000 0.000 ↓ 0.0 0

Index Scan using idx_report_approvals_report_id on report_approvals ra_7 (cost=0.42..12.46 rows=2 width=13) (never executed)

  • Index Cond: ((report_id)::text = (tx_4.report_id)::text)
78. 0.000 0.000 ↓ 0.0 0

Index Only Scan using trip_requests_pkey on trip_requests tr (cost=0.28..0.79 rows=1 width=12) (never executed)

  • Index Cond: (id = (hr.trip_request_id)::text)
  • Heap Fetches: 0
79.          

SubPlan (for Nested Loop)

80. 0.000 0.000 ↓ 0.0 0

Aggregate (cost=12.46..12.47 rows=1 width=13) (never executed)

81. 0.000 0.000 ↓ 0.0 0

Index Scan using idx_report_approvals_report_id on report_approvals ra_6 (cost=0.42..12.46 rows=2 width=13) (never executed)

  • Index Cond: ((report_id)::text = (tx_4.report_id)::text)
82. 0.005 0.125 ↓ 0.0 0 1

Sort (cost=153.48..153.49 rows=1 width=5,038) (actual time=0.125..0.125 rows=0 loops=1)

  • Sort Key: tx_5.created_at
  • Sort Method: quicksort Memory: 25kB
83. 0.001 0.120 ↓ 0.0 0 1

Nested Loop (cost=20.47..153.47 rows=1 width=5,038) (actual time=0.120..0.120 rows=0 loops=1)

84. 0.001 0.119 ↓ 0.0 0 1

Nested Loop (cost=20.19..140.20 rows=1 width=5,061) (actual time=0.119..0.119 rows=0 loops=1)

85. 0.004 0.118 ↓ 0.0 0 1

Hash Join (cost=19.76..119.27 rows=1 width=36) (actual time=0.118..0.118 rows=0 loops=1)

  • Hash Cond: ((hr_1.trip_request_id)::text = (tra_1.trip_request_id)::text)
86. 0.039 0.107 ↑ 28.0 1 1

Hash Join (cost=1.63..100.92 rows=28 width=24) (actual time=0.107..0.107 rows=1 loops=1)

  • Hash Cond: ((hr_1.id)::text = (hbc.id)::text)
87. 0.037 0.037 ↑ 13.9 110 1

Seq Scan on hotel_requests hr_1 (cost=0.00..93.28 rows=1,528 width=22) (actual time=0.001..0.037 rows=110 loops=1)

88. 0.016 0.031 ↓ 1.3 36 1

Hash (cost=1.28..1.28 rows=28 width=21) (actual time=0.031..0.031 rows=36 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 10kB
89. 0.015 0.015 ↓ 1.3 36 1

Seq Scan on hotel_booking_cancellations hbc (cost=0.00..1.28 rows=28 width=21) (actual time=0.005..0.015 rows=36 loops=1)

90. 0.000 0.007 ↓ 0.0 0 1

Hash (cost=18.08..18.08 rows=4 width=12) (actual time=0.007..0.007 rows=0 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 8kB
91. 0.001 0.007 ↓ 0.0 0 1

Bitmap Heap Scan on trip_request_approvals tra_1 (cost=4.31..18.08 rows=4 width=12) (actual time=0.007..0.007 rows=0 loops=1)

  • Recheck Cond: ((approver_id)::text = 'oukRlv4I8fk3'::text)
92. 0.006 0.006 ↓ 0.0 0 1

Bitmap Index Scan on idx_trip_request_approvals_approver_id (cost=0.00..4.31 rows=4 width=0) (actual time=0.006..0.006 rows=0 loops=1)

  • Index Cond: ((approver_id)::text = 'oukRlv4I8fk3'::text)
93. 0.000 0.000 ↓ 0.0 0

Index Scan using transactions_pkey on transactions tx_5 (cost=0.43..20.92 rows=1 width=5,038) (never executed)

  • Index Cond: ((id)::text = (hbc.transaction_id)::text)
  • Filter: ((SubPlan 6) @> '{oukRlv4I8fk3}'::character varying[])
94.          

SubPlan (for Index Scan)

95. 0.000 0.000 ↓ 0.0 0

Aggregate (cost=12.46..12.47 rows=1 width=13) (never executed)

96. 0.000 0.000 ↓ 0.0 0

Index Scan using idx_report_approvals_report_id on report_approvals ra_5 (cost=0.42..12.46 rows=2 width=13) (never executed)

  • Index Cond: ((report_id)::text = (tx_5.report_id)::text)
97. 0.000 0.000 ↓ 0.0 0

Index Only Scan using trip_requests_pkey on trip_requests tr_1 (cost=0.28..0.79 rows=1 width=12) (never executed)

  • Index Cond: (id = (hr_1.trip_request_id)::text)
  • Heap Fetches: 0
98.          

SubPlan (for Nested Loop)

99. 0.000 0.000 ↓ 0.0 0

Aggregate (cost=12.46..12.47 rows=1 width=13) (never executed)

100. 0.000 0.000 ↓ 0.0 0

Index Scan using idx_report_approvals_report_id on report_approvals ra_4 (cost=0.42..12.46 rows=2 width=13) (never executed)

  • Index Cond: ((report_id)::text = (tx_5.report_id)::text)
101. 0.004 0.024 ↓ 0.0 0 1

Sort (cost=861.87..861.87 rows=1 width=5,038) (actual time=0.024..0.024 rows=0 loops=1)

  • Sort Key: tx_6.created_at
  • Sort Method: quicksort Memory: 25kB
102. 0.001 0.020 ↓ 0.0 0 1

Nested Loop (cost=40.08..861.86 rows=1 width=5,038) (actual time=0.020..0.020 rows=0 loops=1)

103. 0.000 0.019 ↓ 0.0 0 1

Nested Loop (cost=39.65..808.31 rows=2 width=13) (actual time=0.019..0.019 rows=0 loops=1)

104. 0.009 0.019 ↓ 0.0 0 1

Hash Join (cost=39.37..806.88 rows=4 width=12) (actual time=0.019..0.019 rows=0 loops=1)

  • Hash Cond: ((tpreq.trip_request_id)::text = (tr_2.id)::text)
105. 0.004 0.004 ↑ 8,980.0 1 1

Seq Scan on transportation_requests tpreq (cost=0.00..733.80 rows=8,980 width=24) (actual time=0.004..0.004 rows=1 loops=1)

106. 0.000 0.006 ↓ 0.0 0 1

Hash (cost=39.32..39.32 rows=4 width=24) (actual time=0.006..0.006 rows=0 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 8kB
107. 0.000 0.006 ↓ 0.0 0 1

Nested Loop (cost=4.60..39.32 rows=4 width=24) (actual time=0.006..0.006 rows=0 loops=1)

108. 0.001 0.006 ↓ 0.0 0 1

Bitmap Heap Scan on trip_request_approvals tra_2 (cost=4.31..18.08 rows=4 width=12) (actual time=0.006..0.006 rows=0 loops=1)

  • Recheck Cond: ((approver_id)::text = 'oukRlv4I8fk3'::text)
109. 0.005 0.005 ↓ 0.0 0 1

Bitmap Index Scan on idx_trip_request_approvals_approver_id (cost=0.00..4.31 rows=4 width=0) (actual time=0.005..0.005 rows=0 loops=1)

  • Index Cond: ((approver_id)::text = 'oukRlv4I8fk3'::text)
110. 0.000 0.000 ↓ 0.0 0

Index Only Scan using trip_requests_pkey on trip_requests tr_2 (cost=0.28..5.30 rows=1 width=12) (never executed)

  • Index Cond: (id = (tra_2.trip_request_id)::text)
  • Heap Fetches: 0
111. 0.000 0.000 ↓ 0.0 0

Index Scan using transportation_bookings_pkey on transportation_bookings tb (cost=0.28..0.35 rows=1 width=25) (never executed)

  • Index Cond: ((id)::text = (tpreq.id)::text)
112. 0.000 0.000 ↓ 0.0 0

Index Scan using transactions_pkey on transactions tx_6 (cost=0.43..20.53 rows=1 width=5,038) (never executed)

  • Index Cond: ((id)::text = (tb.transaction_id)::text)
  • Filter: ((SubPlan 4) @> '{oukRlv4I8fk3}'::character varying[])
113.          

SubPlan (for Index Scan)

114. 0.000 0.000 ↓ 0.0 0

Aggregate (cost=12.46..12.47 rows=1 width=13) (never executed)

115. 0.000 0.000 ↓ 0.0 0

Index Scan using idx_report_approvals_report_id on report_approvals ra_3 (cost=0.42..12.46 rows=2 width=13) (never executed)

  • Index Cond: ((report_id)::text = (tx_6.report_id)::text)
116.          

SubPlan (for Nested Loop)

117. 0.000 0.000 ↓ 0.0 0

Aggregate (cost=12.46..12.47 rows=1 width=13) (never executed)

118. 0.000 0.000 ↓ 0.0 0

Index Scan using idx_report_approvals_report_id on report_approvals ra_2 (cost=0.42..12.46 rows=2 width=13) (never executed)

  • Index Cond: ((report_id)::text = (tx_6.report_id)::text)
119. 0.003 0.210 ↓ 0.0 0 1

Sort (cost=832.09..832.10 rows=1 width=5,038) (actual time=0.210..0.210 rows=0 loops=1)

  • Sort Key: tx_7.created_at
  • Sort Method: quicksort Memory: 25kB
120. 0.001 0.207 ↓ 0.0 0 1

Nested Loop (cost=27.70..832.08 rows=1 width=5,038) (actual time=0.207..0.207 rows=0 loops=1)

121. 0.000 0.206 ↓ 0.0 0 1

Nested Loop (cost=27.42..819.17 rows=1 width=5,062) (actual time=0.206..0.206 rows=0 loops=1)

122. 0.015 0.206 ↓ 0.0 0 1

Hash Join (cost=26.99..798.25 rows=1 width=37) (actual time=0.206..0.206 rows=0 loops=1)

  • Hash Cond: ((tpreq_1.trip_request_id)::text = (tra_3.trip_request_id)::text)
123. 0.022 0.184 ↑ 216.0 1 1

Hash Join (cost=8.86..778.50 rows=216 width=25) (actual time=0.184..0.184 rows=1 loops=1)

  • Hash Cond: ((tpreq_1.id)::text = (tbc.id)::text)
124. 0.014 0.014 ↑ 213.8 42 1

Seq Scan on transportation_requests tpreq_1 (cost=0.00..733.80 rows=8,980 width=24) (actual time=0.001..0.014 rows=42 loops=1)

125. 0.077 0.148 ↓ 1.0 218 1

Hash (cost=6.16..6.16 rows=216 width=25) (actual time=0.148..0.148 rows=218 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 19kB
126. 0.071 0.071 ↓ 1.0 218 1

Seq Scan on transportation_booking_cancellations tbc (cost=0.00..6.16 rows=216 width=25) (actual time=0.005..0.071 rows=218 loops=1)

127. 0.001 0.007 ↓ 0.0 0 1

Hash (cost=18.08..18.08 rows=4 width=12) (actual time=0.007..0.007 rows=0 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 8kB
128. 0.000 0.006 ↓ 0.0 0 1

Bitmap Heap Scan on trip_request_approvals tra_3 (cost=4.31..18.08 rows=4 width=12) (actual time=0.006..0.006 rows=0 loops=1)

  • Recheck Cond: ((approver_id)::text = 'oukRlv4I8fk3'::text)
129. 0.006 0.006 ↓ 0.0 0 1

Bitmap Index Scan on idx_trip_request_approvals_approver_id (cost=0.00..4.31 rows=4 width=0) (actual time=0.006..0.006 rows=0 loops=1)

  • Index Cond: ((approver_id)::text = 'oukRlv4I8fk3'::text)
130. 0.000 0.000 ↓ 0.0 0

Index Scan using transactions_pkey on transactions tx_7 (cost=0.43..20.91 rows=1 width=5,038) (never executed)

  • Index Cond: ((id)::text = (tbc.transaction_id)::text)
  • Filter: ((SubPlan 2) @> '{oukRlv4I8fk3}'::character varying[])
131.          

SubPlan (for Index Scan)

132. 0.000 0.000 ↓ 0.0 0

Aggregate (cost=12.46..12.47 rows=1 width=13) (never executed)

133. 0.000 0.000 ↓ 0.0 0

Index Scan using idx_report_approvals_report_id on report_approvals ra_1 (cost=0.42..12.46 rows=2 width=13) (never executed)

  • Index Cond: ((report_id)::text = (tx_7.report_id)::text)
134. 0.000 0.000 ↓ 0.0 0

Index Only Scan using trip_requests_pkey on trip_requests tr_3 (cost=0.28..0.43 rows=1 width=12) (never executed)

  • Index Cond: (id = (tpreq_1.trip_request_id)::text)
  • Heap Fetches: 0
135.          

SubPlan (for Nested Loop)

136. 0.000 0.000 ↓ 0.0 0

Aggregate (cost=12.46..12.47 rows=1 width=13) (never executed)

137. 0.000 0.000 ↓ 0.0 0

Index Scan using idx_report_approvals_report_id on report_approvals ra (cost=0.42..12.46 rows=2 width=13) (never executed)

  • Index Cond: ((report_id)::text = (tx_7.report_id)::text)
138. 449.981 449.981 ↑ 1.0 1 64,283

Index Scan using org_users_pkey on org_users ou (cost=0.42..7.76 rows=1 width=132) (actual time=0.007..0.007 rows=1 loops=64,283)

  • Index Cond: ((id)::text = (tx.org_user_id)::text)
139. 163.099 176.398 ↓ 1.8 70,292 1

Sort (cost=4,788.92..4,884.62 rows=38,282 width=37) (actual time=155.466..176.398 rows=70,292 loops=1)

  • Sort Key: o.id
  • Sort Method: quicksort Memory: 4082kB
140. 13.299 13.299 ↓ 1.0 38,610 1

Seq Scan on orgs o (cost=0.00..1,874.82 rows=38,282 width=37) (actual time=0.006..13.299 rows=38,610 loops=1)

141. 514.264 514.264 ↑ 1.0 1 64,283

Index Scan using users_pkey on users u (cost=0.42..0.85 rows=1 width=59) (actual time=0.008..0.008 rows=1 loops=64,283)

  • Index Cond: ((id)::text = (ou.user_id)::text)
142. 192.849 192.849 ↑ 1.0 1 64,283

Index Scan using org_categories_pkey on org_categories oc (cost=0.42..8.19 rows=1 width=36) (actual time=0.002..0.003 rows=1 loops=64,283)

  • Index Cond: (id = tx.org_category_id)
143. 642.830 642.830 ↑ 1.0 1 64,283

Index Scan using accounts_pkey on accounts source_account (cost=0.42..8.08 rows=1 width=37) (actual time=0.009..0.010 rows=1 loops=64,283)

  • Index Cond: ((id)::text = (tx.source_account_id)::text)
144. 128.566 128.566 ↓ 0.0 0 64,283

Index Scan using vendors_pkey on vendors v (cost=0.42..8.07 rows=1 width=22) (actual time=0.002..0.002 rows=0 loops=64,283)

  • Index Cond: (tx.vendor_id = id)
145. 0.000 0.000 ↓ 0.0 0 64,283

Index Scan using projects_pkey on projects pj (cost=0.29..6.85 rows=1 width=46) (actual time=0.000..0.000 rows=0 loops=64,283)

  • Index Cond: (tx.project_id = id)
146. 642.830 642.830 ↑ 1.0 1 64,283

Index Scan using reports_pkey on reports r (cost=0.42..8.14 rows=1 width=74) (actual time=0.009..0.010 rows=1 loops=64,283)

  • Index Cond: ((tx.report_id)::text = (id)::text)
147. 385.698 385.698 ↑ 1.0 1 64,283

Index Scan using levels_pkey on levels lvl (cost=0.28..0.30 rows=1 width=41) (actual time=0.005..0.006 rows=1 loops=64,283)

  • Index Cond: ((ou.level_id)::text = (id)::text)
  • Filter: ((ou.org_id)::text = (org_id)::text)
148. 449.981 449.981 ↑ 1.0 1 64,283

Index Scan using departments_pkey on departments dept (cost=0.29..0.32 rows=1 width=56) (actual time=0.007..0.007 rows=1 loops=64,283)

  • Index Cond: ((ou.department_id)::text = (id)::text)
  • Filter: ((ou.org_id)::text = (org_id)::text)
149. 2,185.622 2,185.622 ↓ 1.1 76 64,283

Index Scan using idx_cost_centers_org_id on cost_centers cc (cost=0.29..1.56 rows=71 width=34) (actual time=0.007..0.034 rows=76 loops=64,283)

  • Index Cond: ((ou.org_id)::text = (org_id)::text)
150. 10,606.426 10,606.695 ↑ 1.0 818 64,283

Materialize (cost=0.00..29.27 rows=818 width=33) (actual time=0.000..0.165 rows=818 loops=64,283)

151. 0.269 0.269 ↑ 1.0 818 1

Seq Scan on transaction_external_expense_mappings external_expense (cost=0.00..25.18 rows=818 width=33) (actual time=0.003..0.269 rows=818 loops=1)

152. 385.698 385.698 ↓ 0.0 0 64,283

Index Scan using ccce_transaction_mappings_transaction_id on ccce_transaction_mappings ccce_txn_mapping (cost=0.29..5.27 rows=1 width=28) (actual time=0.006..0.006 rows=0 loops=64,283)

  • Index Cond: ((tx.id)::text = (transaction_id)::text)
Planning time : 19.057 ms
Execution time : 38,293.353 ms