Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

N+1 false positive detection with explicit table #1639

Open
misog opened this issue Jul 31, 2024 · 1 comment
Open

N+1 false positive detection with explicit table #1639

misog opened this issue Jul 31, 2024 · 1 comment

Comments

@misog
Copy link

misog commented Jul 31, 2024

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

@parallels999
Copy link
Contributor

HI, Feel free to make a PR with a Fix

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants