Livewire database query takes 81 seconds but running in database directly takes a few ms #8407
Unanswered
sts-ryan-holton
asked this question in
1. Help
Replies: 2 comments
-
Have you verified the SQL eloquent is generating? ` \DB::enableQueryLog(); // Enable query log // Your Eloquent query executed by using get() dd(\DB::getQueryLog()); // Show results of log ` |
Beta Was this translation helpful? Give feedback.
0 replies
-
Another thing I have done, is to log what queries go out to the database in the AppServiceProvider boot function:
This will show you in the log the actual SQL execuited with any bind parameters. That way I can verify the query on the database is exactly what I expect. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi, I'm using Laravel 11 running through Octane and the latest version of Livewire. I'm using full page component concepts to render pages. I have a dynamic search input that searches the render method for the data, the fields I'm searching on are indexed and am using MySQL 8.
When running the database query presented directly through the database, it's almost instant, or a few seconds at most, but through Livewire and eloquent, the query is taking 80+ seconds. wondering if I'm missing something:
My component file
My SQL:
Beta Was this translation helpful? Give feedback.
All reactions