11 months ago

Optimizing Eloquent Query

Posted 11 months ago by screwtape_mk

I have an autocomplete text box that works well. I need to increase speed of the drop down list. Its too long - you can finish typing before it suggest anything. I have indexed the table and no improvements. So right now I just want to break down the problem into smaller pieces. Lets for now look at the eloquent query itself. Is this the most optimal I could have written it? I got this off the Internet so im not exactly sure why it was written this way it just works- I guess this is how I get to understand the query and optimizing it:

        $query1 = $request->get('term','');
        foreach ($countries as $country) {
             return $data;
            return ['EmployeeService'=>''];

Please sign in or create an account to participate in this conversation.