mpyw/eloquent-has-by-non-dependent-subquery
has() and whereHas() queries by converting dependent subqueries into non-dependent ones, improving performance in MySQL (pre-8.0.16) where correlated subqueries are inefficient. This is valuable for applications with complex relational queries, especially in read-heavy workflows (e.g., dashboards, reporting, or search-heavy features).has()/whereHas() with no breaking changes to existing query syntax. Backward-compatible with Laravel 6–10.WHERE EXISTS → INNER JOIN), increasing memory usage.has()/whereHas() queries are performance-critical?whereHas) that may break?wimski/laravel-ide-helper-hook) improve autocompletion but are optional.has()/whereHas() usages in the codebase.forceIndex() adjustments.EXISTS clauses).whereHas).has()/whereHas() queries.| Scenario | Impact | Mitigation Strategy |
|---|---|---|
| MySQL ≥8.0.16 | No performance benefit | Remove package; use native queries. |
| PostgreSQL/SQLite usage | Performance degradation | Disable package for non-MySQL; use raw SQL. |
| Laravel version incompatibility | Query failures | Fork package or rewrite logic. |
| Over-fetching in JOINs | High memory usage | Add select() clauses to limit columns. |
Nested whereHas edge cases |
Incorrect query generation | Test thoroughly; fall back to raw SQL. |
How can I help you explore Laravel packages today?