explain.depesz.com

PostgreSQL's explain analyze made readable

Result: xntC

Settings
# exclusive inclusive rows x rows loops node
1. 5.461 12,513.613 ↓ 200.0 200 1

Limit (cost=1,403,113.22..1,403,113.22 rows=1 width=9,660) (actual time=12,513.423..12,513.613 rows=200 loops=1)

2. 522.147 12,508.152 ↓ 2,157.1 30,200 1

Sort (cost=1,403,113.19..1,403,113.22 rows=14 width=9,660) (actual time=12,477.159..12,508.152 rows=30,200 loops=1)

  • Sort Key: tx.updated_at, tx.id DESC
  • Sort Method: external merge Disk: 118320kB
3. 87.547 11,986.005 ↓ 4,591.6 64,283 1

Nested Loop Left Join (cost=1,402,096.02..1,403,112.92 rows=14 width=9,660) (actual time=4,227.802..11,986.005 rows=64,283 loops=1)

4. 62.666 11,577.043 ↓ 4,591.6 64,283 1

Nested Loop Left Join (cost=1,402,095.73..1,402,996.51 rows=14 width=9,645) (actual time=4,227.789..11,577.043 rows=64,283 loops=1)

5. 1,293.462 11,257.245 ↓ 4,591.6 64,283 1

Nested Loop Left Join (cost=1,402,095.46..1,402,928.27 rows=14 width=9,625) (actual time=4,227.779..11,257.245 rows=64,283 loops=1)

  • Join Filter: (tx.cost_center_id = cc.id)
  • Rows Removed by Join Filter: 4822817
6. 128.511 7,906.727 ↓ 4,591.6 64,283 1

Nested Loop Left Join (cost=1,402,095.17..1,402,893.99 rows=14 width=9,608) (actual time=4,227.717..7,906.727 rows=64,283 loops=1)

7. 118.681 7,392.518 ↓ 4,591.6 64,283 1

Nested Loop Left Join (cost=1,402,094.88..1,402,889.34 rows=14 width=9,579) (actual time=4,227.699..7,392.518 rows=64,283 loops=1)

8. 112.382 6,952.422 ↓ 4,591.6 64,283 1

Nested Loop Left Join (cost=1,402,094.61..1,402,884.96 rows=14 width=9,579) (actual time=4,227.679..6,952.422 rows=64,283 loops=1)

9. 100.771 6,261.493 ↓ 4,591.6 64,283 1

Nested Loop Left Join (cost=1,402,094.18..1,402,766.66 rows=14 width=9,518) (actual time=4,227.660..6,261.493 rows=64,283 loops=1)

10. 56.403 6,160.722 ↓ 4,591.6 64,283 1

Nested Loop Left Join (cost=1,402,093.90..1,402,650.25 rows=14 width=9,476) (actual time=4,227.657..6,160.722 rows=64,283 loops=1)

11. 80.508 5,975.753 ↓ 4,591.6 64,283 1

Nested Loop Left Join (cost=1,402,093.47..1,402,531.95 rows=14 width=9,458) (actual time=4,227.653..5,975.753 rows=64,283 loops=1)

12. 71.521 5,316.698 ↓ 4,591.6 64,283 1

Nested Loop (cost=1,402,093.05..1,402,413.68 rows=14 width=9,421) (actual time=4,227.634..5,316.698 rows=64,283 loops=1)

13. 71.677 5,052.328 ↓ 4,591.6 64,283 1

Nested Loop (cost=1,402,092.63..1,402,295.35 rows=14 width=9,389) (actual time=4,227.623..5,052.328 rows=64,283 loops=1)

14. 142.212 4,466.387 ↓ 4,591.6 64,283 1

Merge Join (cost=1,402,092.21..1,402,283.28 rows=14 width=9,343) (actual time=4,227.600..4,466.387 rows=64,283 loops=1)

  • Merge Cond: ((ou.org_id)::text = (o.id)::text)
15. 345.207 4,149.094 ↓ 4,591.6 64,283 1

Sort (cost=1,397,302.74..1,397,302.77 rows=14 width=9,319) (actual time=4,068.726..4,149.094 rows=64,283 loops=1)

  • Sort Key: ou.org_id
  • Sort Method: external sort Disk: 104264kB
16. 108.446 3,803.887 ↓ 4,591.6 64,283 1

Nested Loop (cost=1,397,179.27..1,397,302.47 rows=14 width=9,319) (actual time=2,974.989..3,803.887 rows=64,283 loops=1)

17. 87.364 3,245.460 ↓ 4,591.6 64,283 1

Unique (cost=1,397,178.85..1,397,184.10 rows=14 width=5,038) (actual time=2,974.957..3,245.460 rows=64,283 loops=1)

18. 604.920 3,158.096 ↓ 4,591.6 64,283 1

Sort (cost=1,397,178.85..1,397,178.89 rows=14 width=5,038) (actual time=2,974.955..3,158.096 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: 97904kB
19. 26.356 2,553.176 ↓ 4,591.6 64,283 1

Append (cost=3,105.42..1,397,178.58 rows=14 width=5,038) (actual time=2,463.331..2,553.176 rows=64,283 loops=1)

20. 0.003 3.853 ↓ 0.0 0 1

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

  • Sort Key: tx.created_at
  • Sort Method: quicksort Memory: 25kB
21. 0.601 3.850 ↓ 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.850..3.850 rows=0 loops=1)

  • Index Cond: ((org_user_id)::text = 'oukRlv4I8fk3'::text)
  • Filter: ((SubPlan 16) ~~ '%oukRlv4I8fk3%'::text)
  • 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.722 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.527 2.527 ↑ 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.007 rows=1 loops=361)

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

Sort (cost=136,763.33..136,763.33 rows=1 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.001 0.018 ↓ 0.0 0 1

Nested Loop (cost=9.12..136,763.32 rows=1 width=5,038) (actual time=0.018..0.018 rows=0 loops=1)

29. 0.001 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.001 0.016 ↓ 0.0 0 1

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

31. 0.009 0.009 ↓ 0.0 0 1

Bitmap Index Scan on idx_projects_approver1_id (cost=0.00..4.35 rows=9 width=0) (actual time=0.009..0.009 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=1 width=5,038) (never executed)

  • Index Cond: (project_id = p.id)
  • Filter: ((SubPlan 14) ~~ '%oukRlv4I8fk3%'::text)
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.147 ↓ 0.0 0 1

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

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

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

42. 0.001 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.144 1.144 ↓ 0.0 0 1

Seq Scan on departments d (cost=0.00..533.29 rows=1 width=15) (actual time=1.144..1.144 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%'::text)
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. 361.205 2,521.431 ↓ 9,183.3 64,283 1

Sort (cost=1,234,370.20..1,234,370.22 rows=7 width=5,038) (actual time=2,458.307..2,521.431 rows=64,283 loops=1)

  • Sort Key: tx_3.created_at
  • Sort Method: external merge Disk: 97912kB
54. 115.813 2,160.226 ↓ 9,183.3 64,283 1

Nested Loop (cost=2,266.96..1,234,370.10 rows=7 width=5,038) (actual time=8.474..2,160.226 rows=64,283 loops=1)

55. 43.085 49.264 ↑ 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.421..49.264 rows=64,391 loops=1)

  • Recheck Cond: ((approver_id)::text = 'oukRlv4I8fk3'::text)
  • Heap Blocks: exact=14395
56. 6.179 6.179 ↑ 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.179..6.179 rows=64,391 loops=1)

  • Index Cond: ((approver_id)::text = 'oukRlv4I8fk3'::text)
57. 837.083 1,416.602 ↑ 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.021..0.022 rows=1 loops=64,391)

  • Index Cond: ((id)::text = (ta.transaction_id)::text)
  • Filter: ((SubPlan 10) ~~ '%oukRlv4I8fk3%'::text)
  • Rows Removed by Filter: 0
58.          

SubPlan (for Index Scan)

59. 128.782 579.519 ↑ 1.0 1 64,391

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

60. 450.737 450.737 ↑ 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.007..0.007 rows=2 loops=64,391)

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

SubPlan (for Nested Loop)

62. 128.566 578.547 ↑ 1.0 1 64,283

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

63. 449.981 449.981 ↑ 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.006..0.007 rows=2 loops=64,283)

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

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

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

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

66. 0.001 0.032 ↓ 0.0 0 1

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

67. 0.000 0.031 ↓ 0.0 0 1

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

68. 0.010 0.031 ↓ 0.0 0 1

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

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

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

70. 0.000 0.015 ↓ 0.0 0 1

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

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

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

  • Recheck Cond: ((approver_id)::text = 'oukRlv4I8fk3'::text)
72. 0.013 0.013 ↓ 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.013..0.013 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%'::text)
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.003 0.121 ↓ 0.0 0 1

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

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

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

84. 0.000 0.117 ↓ 0.0 0 1

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

85. 0.005 0.117 ↓ 0.0 0 1

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

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

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

  • Hash Cond: ((hr_1.id)::text = (hbc.id)::text)
87. 0.038 0.038 ↑ 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.038 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.000 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.007 0.007 ↓ 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.007..0.007 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%'::text)
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.002 0.018 ↓ 0.0 0 1

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

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

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

103. 0.000 0.015 ↓ 0.0 0 1

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

104. 0.006 0.015 ↓ 0.0 0 1

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

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

Seq Scan on transportation_requests tpreq (cost=0.00..733.80 rows=8,980 width=24) (actual time=0.003..0.003 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%'::text)
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.002 0.187 ↓ 0.0 0 1

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

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

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

121. 0.001 0.185 ↓ 0.0 0 1

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

122. 0.005 0.184 ↓ 0.0 0 1

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

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

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

  • Hash Cond: ((tpreq_1.id)::text = (tbc.id)::text)
124. 0.012 0.012 ↑ 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.012 rows=42 loops=1)

125. 0.069 0.141 ↓ 1.0 218 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 19kB
126. 0.072 0.072 ↓ 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.072 rows=218 loops=1)

127. 0.000 0.006 ↓ 0.0 0 1

Hash (cost=18.08..18.08 rows=4 width=12) (actual time=0.006..0.006 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%'::text)
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..8.44 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. 161.886 175.081 ↓ 1.8 70,292 1

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

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

Seq Scan on orgs o (cost=0.00..1,874.82 rows=38,282 width=37) (actual time=0.005..13.195 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.007..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.44 rows=1 width=36) (actual time=0.002..0.003 rows=1 loops=64,283)

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

Index Scan using accounts_pkey on accounts source_account (cost=0.42..8.44 rows=1 width=37) (actual time=0.008..0.009 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.44 rows=1 width=22) (actual time=0.001..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..8.30 rows=1 width=46) (actual time=0.000..0.000 rows=0 loops=64,283)

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

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

  • Index Cond: ((tx.report_id)::text = (id)::text)
147. 321.415 321.415 ↑ 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.005 rows=1 loops=64,283)

  • Index Cond: ((ou.level_id)::text = (id)::text)
  • Filter: ((ou.org_id)::text = (org_id)::text)
148. 385.698 385.698 ↑ 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.006..0.006 rows=1 loops=64,283)

  • Index Cond: ((ou.department_id)::text = (id)::text)
  • Filter: ((ou.org_id)::text = (org_id)::text)
149. 2,057.056 2,057.056 ↓ 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.006..0.032 rows=76 loops=64,283)

  • Index Cond: ((ou.org_id)::text = (org_id)::text)
150. 257.132 257.132 ↓ 0.0 0 64,283

Index Scan using idx_transaction_external_expense_mappings_transaction_id on transaction_external_expense_mappings external_expense (cost=0.28..4.86 rows=1 width=33) (actual time=0.004..0.004 rows=0 loops=64,283)

  • Index Cond: ((tx.id)::text = (transaction_id)::text)
151. 321.415 321.415 ↓ 0.0 0 64,283

Index Scan using unique_transaction_id on ccce_transaction_mappings ccce_txn_mapping (cost=0.29..8.30 rows=1 width=28) (actual time=0.005..0.005 rows=0 loops=64,283)

  • Index Cond: ((tx.id)::text = (transaction_id)::text)
Planning time : 18.999 ms
Execution time : 12,574.826 ms