Skip to content

Commit 61ba92b

Browse files
littleopaclaude
andcommitted
fix(database): downgrade the joins-without-index rule to a notice
The core setup checks for missing columns, indices, primary keys and bigint conversions each introspect the whole schema. On MySQL/MariaDB those queries join information_schema tables, which have no indexes, so every visit of Administration -> Overview adds to Select_full_join. On a small instance a few visits are enough to cross the 0.05% threshold, and the recommendation (add the missing indexes) cannot be acted on. Treat it like Join_without_index_rate in #1167: report it as a notice, so it no longer turns the setup check into a warning. Fixes #1245 Assisted-by: ClaudeCode:claude-opus-5-5 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019TNUHUT6jaQ3BHvjvdf4Ny Signed-off-by: Phillipxh <150742483+Phillipxh@users.noreply.github.com>
1 parent 2a3573e commit 61ba92b

2 files changed

Lines changed: 16 additions & 1 deletion

File tree

‎lib/Database/RuleSet/Mysql.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ private function build(): array {
181181
id: 'Select_full_join',
182182
name: 'Joins without indexes',
183183
category: 'Performance',
184-
severity: Rule::SEVERITY_WARNING,
184+
severity: Rule::SEVERITY_NOTICE,
185185
formula: 'Select_full_join / Questions * 100',
186186
test: 'value > 0.05',
187187
issue: 'Some joins are scanning entire tables because no usable index exists on the join column.',

‎tests/lib/Database/AdvisorTest.php‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,4 +150,19 @@ public function testJoinWithoutIndexRateIsANotice(): void {
150150
$this->assertSame(RuleResult::STATUS_FAIL, $result->status);
151151
$this->assertSame(Rule::SEVERITY_NOTICE, $result->rule->severity);
152152
}
153+
154+
/**
155+
* The schema introspection of the setup checks joins information_schema
156+
* tables, which have no indexes, so every visit of the overview page adds
157+
* to Select_full_join. An admin cannot act on it, so it is only a hint.
158+
*/
159+
public function testSelectFullJoinIsANotice(): void {
160+
$result = $this->resultFor('Select_full_join', [
161+
'Select_full_join' => 96,
162+
'Questions' => 71025,
163+
]);
164+
165+
$this->assertSame(RuleResult::STATUS_FAIL, $result->status);
166+
$this->assertSame(Rule::SEVERITY_NOTICE, $result->rule->severity);
167+
}
153168
}

0 commit comments

Comments
 (0)