laravel-debugbar icon indicating copy to clipboard operation
laravel-debugbar copied to clipboard

N+1 false positive detection with explicit table

Open misog opened this issue 6 months ago • 1 comments

Hi, this generates false positive N+1 detection when using explicit table: $query->where($table . '.' . 'uuid', $key);

select * from `account_memberships`
where `account_memberships`.`user_id` = ?
and `account_memberships`.`user_id` is not null
and `account_memberships`.`uuid` = ?
limit 1

This is the same except the table is not specified and this does not detect N+1:

select * from `account_memberships`
where `account_memberships`.`user_id` = ?
and `account_memberships`.`user_id` is not null
and `uuid` = ?
limit 1

Version 3.13.5

misog avatar Jul 31 '24 10:07 misog