建议删除TableController.php 下面的count统计查询

Open Beginner friendly
#101 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
1/5
Estimated time
Under an hour
Newbie friendliness
62/100
Issue type
Refactor
Clarity
Clearly specified
Activity status
Stale
Tech stack
php
Domain
backend, databases

Research direction

Start in TableController.php and inspect the shown table-listing code, especially the per-table Util::db()->table($table_name)->count() calls. Remove the count-query block and verify that table listing still works without replacing TABLE_ROWS values; check any existing controller or integration tests if available.

Written by the indexing model from the issue text.

Description

if ($tables) { $table_names = array_column($tables, 'TABLE_NAME'); $table_rows_count = []; foreach ($table_names as $table_name) { $table_rows_count[$table_name] = Util::db()->table($table_name)->count(); } foreach ($tables as $key => $table) { $tables[$key]->TABLE_ROWS = $table_rows_count[$table->TABLE_NAME] ?? $table->TABLE_ROWS; } }
建议删除掉这段代码,当你得数据库单表数量高时查询会变得非常慢,这个数量看不看影响都不大。

Dominant language
JavaScript
Stars
378
Forks
48
Avg merge
20h 9m
Merged PRs (30d)
2

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from webman-php/admin

All issues in webman-php/admin

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.