Query Metrics

7 Database Queries
7 Different statements
7.45 ms Query time
1 Invalid entities

Grouped Statements

Show all queries

Time Count Info
2.40 ms
(32.26%)
1
select d.id, d.user_id,d.is_closed,d.account_date,d.station_daily_account,d.closed_by,d.created_at,
                sum(a.amount) as total_amount,
                (select sum(cash_amount) from transaction where is_cancelled = 0 and daily_account_id = d.id) as cash_amount,
                (select sum(mpesa_amount) from transaction where is_cancelled = 0 and daily_account_id = d.id AND payment_method = "MPESA" ) as mpesa_amount,
                (select sum(mpesa_amount) from transaction where is_cancelled = 0 and daily_account_id = d.id and payment_method = "MPESA_CASH") as mpesa_cash,
                (select count(id) from transaction where is_cancelled = 0 and daily_account_id = d.id and payment_method = "MPESA") as un_accounted_mpesa_count,
                (select count(id) from transaction where is_cancelled = 0 and daily_account_id = d.id) as transactions_no,
                (select sum(amount) from transaction where is_cancelled = 1 and daily_account_id = d.id) as cancelled,
                (select count(id) from transaction where is_cancelled = 1 and daily_account_id = d.id) as cancelled_count,
                (select  sum(amount) from station_expense where daily_account_id = d.id AND is_cancelled = false) as total_expenses
                FROM transaction a
                    JOIN transaction b ON b.id = a.id
                    JOIN daily_account d ON a.daily_account_id = d.id
                    WHERE d.id =:daily_account
Parameters:
[
  "daily_account" => 32817
]
1.27 ms
(17.06%)
1
SELECT t0.id AS id_1, t0.drawer_cash AS drawer_cash_2, t0.account_date AS account_date_3, t0.is_closed AS is_closed_4, t0.created_at AS created_at_5, t0.user_id AS user_id_6, t0.station_daily_account AS station_daily_account_7, t0.closed_by AS closed_by_8 FROM daily_account t0 WHERE t0.user_id = ? ORDER BY t0.id DESC LIMIT 1
Parameters:
[
  47
]
1.18 ms
(15.87%)
1
SELECT t0.id AS id_1, t0.amount AS amount_2, t0.cash_amount AS cash_amount_3, t0.mpesa_amount AS mpesa_amount_4, t0.tax_percentage AS tax_percentage_5, t0.tax_amount AS tax_amount_6, t0.gross_amount AS gross_amount_7, t0.station_expenses AS station_expenses_8, t0.station_balance AS station_balance_9, t0.expenses AS expenses_10, t0.balance AS balance_11, t0.created_at AS created_at_12, t0.is_cancelled AS is_cancelled_13, t0.is_complete AS is_complete_14, t0.is_paid AS is_paid_15, t0.paid_by AS paid_by_16, t0.mpesa_payment_phone AS mpesa_payment_phone_17, t0.payment_method AS payment_method_18, t0.pin_number AS pin_number_19, t0.cu_invoice_number AS cu_invoice_number_20, t0.cu_invoice_number_credit AS cu_invoice_number_credit_21, t0.cu_serial_number AS cu_serial_number_22, t0.is_final AS is_final_23, t0.way_bill_id AS way_bill_id_24, t0.created_by AS created_by_25, t0.organization_id AS organization_id_26, t0.daily_account_id AS daily_account_id_27 FROM transaction t0 WHERE t0.is_cancelled = ? AND t0.daily_account_id = ?
Parameters:
[
  1
  32817
]
0.75 ms
(10.08%)
1
SELECT t0.id AS id_1, t0.first_name AS first_name_2, t0.second_name AS second_name_3, t0.sir_name AS sir_name_4, t0.gender AS gender_5, t0.national_id AS national_id_6, t0.phone_number AS phone_number_7, t0.created_at AS created_at_8, t0.date_of_birth AS date_of_birth_9, t0.preferred_name AS preferred_name_10, t0.created_by AS created_by_11 FROM person t0 WHERE t0.id = ?
Parameters:
[
  49
]
0.70 ms
(9.36%)
1
SELECT t0.id AS id_1, t0.station_name AS station_name_2, t0.station_address AS station_address_3, t0.phone_numbers AS phone_numbers_4, t0.created_at AS created_at_5, t0.operating_hrs AS operating_hrs_6, t0.is_mobile AS is_mobile_7, t0.organization_id AS organization_id_8, t0.created_by AS created_by_9 FROM station t0 WHERE t0.id = ? LIMIT 1
Parameters:
[
  1
]
0.70 ms
(9.35%)
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 = ?
Parameters:
[
  47
]
0.45 ms
(6.01%)
1
SELECT t0.id AS id_1, t0.amount AS amount_2, t0.expense_accrued AS expense_accrued_3, t0.description AS description_4, t0.created_at AS created_at_5, t0.is_cancelled AS is_cancelled_6, t0.station_id AS station_id_7, t0.daily_account_id AS daily_account_id_8, t0.expense_type_id AS expense_type_id_9, t0.created_by AS created_by_10 FROM station_expense t0 WHERE t0.daily_account_id = ?
Parameters:
[
  32817
]

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\Station No errors.
App\Entity\Organization No errors.
App\Entity\DailyAccount No errors.
App\Entity\StationDailyAccount No errors.
App\Entity\StationExpense No errors.
App\Entity\Transaction No errors.
App\Entity\WayBill
  • The field App\Entity\WayBill#collectedParcel is on the inverse side of a bi-directional relationship, but the specified mappedBy association on the target-entity App\Entity\CollectedParcel#waybill does not contain the required 'inversedBy="collectedParcel"' attribute.
App\Entity\ExpenseType No errors.