https://courier.ohau.co.ke/api/daily_account

Query Metrics

2 Database Queries
2 Different statements
4.30 ms Query time
0 Invalid entities

Grouped Statements

Show all queries

Time Count Info
3.54 ms
(82.49%)
1
SELECT a.id, 
                       (select count(*) from transaction where created_by = a.user_id and daily_account_id = a.id) as transactions,
                       (select sum(amount) from transaction where created_by = a.user_id and daily_account_id = a.id and is_cancelled = false) as transactions_amount,
                       
                       (select count(*) from transaction where created_by = a.user_id and is_cancelled = true and daily_account_id = a.id) as cancelled_transactions,
                       (select sum(amount) from transaction where created_by = a.user_id and is_cancelled = true and daily_account_id = a.id) as cancelled_amount,
                       
                       (select count(*) from transaction where created_by = a.user_id and is_cancelled = false and mpesa_amount > 0 and daily_account_id = a.id) as mpesa_transactions,
                       (select sum(mpesa_amount) from transaction where created_by = a.user_id and is_cancelled = false and mpesa_amount > 0 and daily_account_id = a.id) as mpesa_amount,
                       
                       (select count(*) from transaction where created_by = a.user_id and is_cancelled = false and cash_amount > 0 and daily_account_id = a.id) as cash_transactions,
                       (select sum(cash_amount) from transaction where created_by = a.user_id and is_cancelled = false and cash_amount > 0 and daily_account_id = a.id) as cash_amount,
                      (SELECT sum(inner_a.amount) FROM station_expense inner_a WHERE inner_a.daily_account_id = a.id and inner_a.is_cancelled = false  ) as expenses,
                      (SELECT count(*) FROM station_expense inner_a WHERE inner_a.daily_account_id = a.id and inner_a.is_cancelled = false  ) as expenses_count
                    FROM daily_account a  where a.user_id = 119 and a.is_closed = 0 ORDER BY a.id desc LIMIT 1
Parameters:
[]
0.75 ms
(17.51%)
1
SELECT t0.id AS id_1, t0.username AS username_2, t0.password AS password_3, t0.created_at AS created_at_4, t0.roles AS roles_5, t0.email AS email_6, t0.person_id AS person_id_7 FROM user t0 WHERE t0.id = ? LIMIT 1
Parameters:
[
  119
]

Database Connections

Name Service
default doctrine.dbal.default_connection

Entity Managers

Name Service
default doctrine.orm.default_entity_manager

Second Level Cache

Second Level Cache is not enabled.

Entities Mapping

Class Mapping errors
App\Entity\User No errors.
App\Entity\Person No errors.
App\Entity\DailyAccount No errors.