Download the PHP package zxch/indexlens without Composer
On this page you can find all versions of the php package zxch/indexlens. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download zxch/indexlens
More information about zxch/indexlens
Files in zxch/indexlens
Package indexlens
Short Description Intelligent database query observability and optimization package for Laravel.
License MIT
Informations about the package indexlens
IndexLens
Intelligent query observability and optimization engine for Laravel.
IndexLens is built for teams that want to move beyond basic query logs. It captures runtime SQL behavior, explains performance bottlenecks, recommends practical fixes, and guards performance budgets in CI.
Why IndexLens
Most tooling can tell you what query ran. IndexLens tells you why it is expensive, where it hurts in your routes, and what to do next.
It is designed to detect:
- N+1 query patterns and duplicate query storms
- missing indexes across WHERE, JOIN, ORDER BY, GROUP BY
- full table scans and filesort risks from EXPLAIN plans
- route-level bottlenecks and memory-heavy hydration patterns
- performance regressions across deployments
Core Intelligence
Query Interceptor Engine
- Captures SQL, bindings, timing, connection, route name, URL, action, user ID
- Tracks memory before and after each query
- Tracks request duration and query fingerprint per request
N+1 + Duplicate Detection
- Groups normalized SQL and flags repeated patterns
- Returns severity, explanation, and eager loading recommendation
- Generates suggested code snippets when relation/model candidates are detected
Missing Index Recommendation
- Extracts candidate columns from WHERE/JOIN/ORDER BY/GROUP BY usage
- Checks existing index metadata (MySQL and PostgreSQL paths)
- Outputs actionable SQL suggestions with reason and severity
SQL EXPLAIN Intelligence
- Runs EXPLAIN for slow queries
- Interprets scan type, filesort, temporary table, missing keys, row estimates
- Produces optimization score, severity, and human-readable strategy
Route Performance Heatmap
- Aggregates average query count, SQL time, memory, request count per route
- Assigns route score and severity ranking
- Makes worst endpoints visible immediately
Regression Detection
- Compares latest route baseline against previous baseline
- Flags significant growth in query count and route SQL latency
- Stores regression snapshots for team visibility
CI Performance Budget
- Fails pipeline when route performance exceeds configured thresholds
- Intended for pull request enforcement and deployment safety
Installation
Optional debug view publish:
Configuration
Facade API
Artisan Commands
Production Mode Presets
off: fully disabledsafe: production low-overhead mode (sampling on, no explain, no profile persistence)balanced: default behaviorinvestigate: capture-rich mode for short investigations
Recommended production .env baseline:
Example Findings
N+1 finding:
Index recommendation:
Regression output:
Route heatmap snapshot:
CI Usage (GitHub Actions)
Important:
- For this package repository, run package tests only.
- Run IndexLens runtime budgets in the host Laravel application repository where an artisan file and real route/query traffic exist.
Debug View
Architecture
License
MIT
All versions of indexlens with dependencies
illuminate/support Version ^10.0|^11.0|^12.0
illuminate/database Version ^10.0|^11.0|^12.0
illuminate/console Version ^10.0|^11.0|^12.0
symfony/console Version ^6.0|^7.0