Download the PHP package verbanent/laravel-sql-performance-guard without Composer

On this page you can find all versions of the php package verbanent/laravel-sql-performance-guard. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-sql-performance-guard

Laravel SQL Performance Guard

A service provider to monitor SQL statements, check the performance (EXPLAIN command), view real-time queries, and collect SQL logs to optimise them.

Installation

Please install the package via Composer:

You can publish the config file if you need to change its default values:

Default settings:

Usage

Currently, the library works only in the debug mode. Please run it in your development environment to test SQL queries and make required amends to improve the SQL performance. If you see better results, apply these changes to your Production environment.

Example

Install a package and check your logs:

Change your application mode to DEBUG by updating your .env file:

It's just an example. If you configured your logs you might not need to do any changes here.

Open a page or run a CLI command to trigger saving debug logs. You should something like this:

We see the problem is that the query doesn't use any indexes (keys) to filter results. It means it must go through more than 80.000 rows to get the results.

Based on this knowledge let's optimise our table users by adding an index:

It's better know:

But still not perfect. There's the last warning related to the key length. It means that the column contains longer strings and our index might be huge if we don't limit it. Let's try to fix it based on that information:

The results show all tests passed:

This is a simple tool to help you diagnose the issue with your queries based on the EXPLAIN command. It should be used during your developing process. We don't recommend running it in your Production environment.


All versions of laravel-sql-performance-guard with dependencies

PHP Build Version
Package Version
Requires php Version ^8.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package verbanent/laravel-sql-performance-guard contains the following files

Loading the files please wait ....