In my recent Sentry reports, I found several N+1 query issue reports on various different admin panel pages. Looking into them, I noticed that on basically all pages visited, for each table available in my database, there are two queries being fired (regardless of page content):
select column_name as `name`, data_type as `type_name`, column_type as `type`,
collation_name as `collation`, is_nullable as `nullable`,
column_default as `default`, column_comment as `comment`,
generation_expression as `expression`, extra as `extra`
from information_schema.columns
where table_schema = 'FOO'
and table_name = 'BAR'
order by ordinal_position asc
select index_name as `name`, group_concat(column_name order by seq_in_index) as `columns`,
index_type as `type`, not non_unique as `unique`
from information_schema.statistics
where table_schema = 'FOO'
and table_name = 'BAR'
group by index_name, index_type, non_unique
What I expected to happen
No obsolete queries being fired.
What happened
A lot of queries fetching data that seems largely obsolete.
What I've already tried to fix it
My observations and thoughts:
this only started appearing recently; I suspect the Laravel 11 upgrade for my application is involved
the bug is not present when I checkout an old tag running on Laravel 10.48.3 + Backpack CRUD 6.7.0
Given that I'm not immediately sure about the moving parts involved, I've decided to stick with reporting this for now. If more info/help is needed, let me know, then I'll happily assist in tracking down the source of this issue.
Is it a bug in the latest version of Backpack?
Yes
Backpack, Laravel, PHP, DB version
When I run php artisan backpack:version the output is:
Bug report
What I did
In my recent Sentry reports, I found several N+1 query issue reports on various different admin panel pages. Looking into them, I noticed that on basically all pages visited, for each table available in my database, there are two queries being fired (regardless of page content):
What I expected to happen
No obsolete queries being fired.
What happened
A lot of queries fetching data that seems largely obsolete.
What I've already tried to fix it
My observations and thoughts:
Given that I'm not immediately sure about the moving parts involved, I've decided to stick with reporting this for now. If more info/help is needed, let me know, then I'll happily assist in tracking down the source of this issue.
Is it a bug in the latest version of Backpack?
Yes
Backpack, Laravel, PHP, DB version
When I run
php artisan backpack:version
the output is:Further info: running this on MySQL databases, both 8.0.x and 8.4.0.