Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions core/Command/Db/DbIndexUsage.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
use Symfony\Component\Console\Output\OutputInterface;

class DbIndexUsage extends Command {

public function __construct(
private readonly Connection $connection,
) {
Expand All @@ -46,8 +45,8 @@ protected function execute(InputInterface $input, OutputInterface $output): int
$unused_filter = $showAll ? '' : "WHERE s.count_read = 0 AND s.index_name IS NOT NULL AND s.index_name != 'PRIMARY'";
$sql = "SELECT s.object_name AS `table`,
s.index_name AS `index`,
s.count_read AS reads,
s.count_write AS writes
s.count_read AS `reads`,
s.count_write AS `writes`
FROM performance_schema.table_io_waits_summary_by_index_usage s
{$unused_filter}
ORDER BY s.object_name, s.index_name";
Expand Down Expand Up @@ -105,7 +104,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
if (!$showAll) {
$output->writeln(sprintf(
'<comment>Found %d unused index(es). If those were not created by Nextcloud, consider removing them to improve write performance.</comment>',
count($rows)
count($rows),
));
}

Expand Down
Loading