query Archives - 7-Views

How To Debug Queries In Laravel

Posted by
January 31, 2021

We can do this by #1 Simple Query Debugging $results = User::where(function($q) use ($request) { $q->orWhere(‘name’, ‘like’, ‘%7-Views%’); $q->orWhere(’email’, ‘=’, ‘info@7-views.com’); })->toSql(); The above method does not include query bindings. #2 Listening For Query Events \DB::listen(function($sql, $bindings, $time) { dump($sql); dump($bindings); dump($time); }); This method returns queries with timings and bindings.        

read more

Defragment to Recover Space in MYSQL

Posted by
August 24, 2018

If our application is performing a lot of update delete operations on a certain table then there is high possibility that it contains fragmented space. The OPTIMIZE TABLE statement allows MySQL DBAs to reorganize physical table storage in order to achieve three main goals: Shrinks the data pages Shrinks index pages Computes Fresh Index Statistics […]

read more