Missing Index Candidate (ARCH7058)
Dieser Inhalt ist noch nicht in deiner Sprache verfügbar.
Key php.orm.missing-index-candidate · Severity info · Category orm
When a column is repeatedly used in filter/order/lookup predicates but has no index declaration, queries fall back to full table scans. Such columns are candidates for a DB index.
Incorrect
Section titled “Incorrect”<?php// 'email' is filtered often but has no index in the migrationSchema::create('users', function ($table) { $table->id(); $table->string('email');});Correct
Section titled “Correct”<?phpSchema::create('users', function ($table) { $table->id(); $table->string('email')->index(); // index the frequently-filtered column});Add an appropriate database index to frequently filtered/sorted columns.