PostgreSQL – Using Explain to Check Index
In PostgreSQL you can check if an index is being used for a query by using the EXPLAIN (ANALYZE , BUFFERS) before the query like: EXPLAIN (ANALYZE, BUFFERS) SELECT *…
In PostgreSQL you can check if an index is being used for a query by using the EXPLAIN (ANALYZE , BUFFERS) before the query like: EXPLAIN (ANALYZE, BUFFERS) SELECT *…
If you want to log all SQL queries to the laravel.log file use the following code in your AppServiceProvider.php - boot() method: class AppServiceProvider extends ServiceProvider { // ... public…
Laravel offers several ways to check the performance of an eloquent query. 1] Using DB query log You can log the SQL queries and get the performance of individual queries…
In a tweet by Tom Herrmann (@devgummibeer) (https://gummibeer.dev/), he discussed how using syncWithoutDetaching() call can kill a database. Basically, instead of doing: $user->identifiers()->syncWithoutDetaching($identifiers); Do this: DB::table('identifier_user')->having()->insertOrIgnore( $identifiers->map(fn (Identifier $identifier) =>…