Database checks: `Select_full_join` warning is caused by the setup checks' own schema introspection
Maintainer thường phản hồi trong vòng 1 ngày
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 45/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- javascript, mariadb, php
- Lĩnh vực
- backend, databases, observability
Hướng nghiên cứu
Start by tracing the four named core setup checks and their SchemaWrapper construction, then inspect how serverinfo evaluates the Select_full_join threshold. Reproduce the reported increase by opening Administration → Overview against MariaDB with the described slow query filter. Done means Overview visits no longer cause this database check to fail; the issue lists downgrading the counter to a notice or excluding setup checks as possible approaches.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Setup
- Nextcloud 35.0.2, serverinfo 7.0.0
- MariaDB 11.8.9 (Alpine package), local socket, same host
- PHP 8.5, nginx
occ db:add-missing-indices, missing columns and missing primary keys all report nothing
Bug description
Overview reports "Joins without indexes" (Select_full_join) as a failing warning: 0.1378% of queries did a full join without an index (96 full joins out of 71,025 queries over 33 h; the threshold is 0.05%).
To find the queries, I set this for one hour:
SET GLOBAL log_slow_filter = 'full_join', long_query_time = 0, log_slow_verbosity = 'query_plan,explain';
Results:
Select_full_joinwent from 96 to 108, so there were 12 full joins in the hour.- All 12 came from one database connection within one second (10:09:00–10:09:01).
- That second matches a single
GET /index.php/settings/adminin the web server log, i.e. opening Administration → Overview. - The 12 are Doctrine schema introspection queries against
information_schema: 3 different queries, each run 4 times:TABLESjoined withCOLLATION_CHARACTER_SET_APPLICABILITYCOLUMNSjoined withTABLES, with aCHECK_CONSTRAINTSsubqueryKEY_COLUMN_USAGEjoined withREFERENTIAL_CONSTRAINTS
- The 4 runs come from the core setup checks
DatabaseHasMissingColumns,DatabaseHasMissingIndices,DatabaseHasMissingPrimaryKeysandDatabasePendingBigIntConversions. Each one createsnew SchemaWrapper($connection), which introspects the whole schema.
information_schema tables have no indexes, so these joins are always counted as full joins. The query plans:
PRIMARY t ALL NULL TABLE_SCHEMA ... 138 Using where; Open_frm_only; Scanned 1 database; Using temporary; Using filesort
PRIMARY c ALL NULL TABLE_SCHEMA ... 946 Using where; Open_frm_only; Scanned 1 database; Using join buffer (flat, BNL join)
SIMPLE ccsa ALL NULL NULL ... 1288 Using where; Using join buffer (flat, BNL join)
SIMPLE k ALL NULL TABLE_SCHEMA ... 315 Using where; Open_full_table; Scanned 1 database; Using temporary; Using filesort
SIMPLE c ALL NULL CONSTRAINT_SCHEMA ... 11 Using where; Open_full_table; Scanned 1 database; Using join buffer (flat, BNL join)
So every Overview visit adds 12 to Select_full_join. The 96 since the last MariaDB restart is a multiple of 12 (consistent with 8 visits). On a small instance with little query volume, a handful of visits is enough to cross 0.05%. The check fails because the admin looked at it.
Following the recommendation (find the queries, add indexes) leads nowhere: the "missing indexes" are on MariaDB's catalogue tables. Also, on MariaDB log_queries_not_using_indexes (from the recommendation) logs far more than full joins. log_slow_filter = 'full_join' with long_query_time = 0 is what isolates them.
Expected behavior
Viewing the Overview page shouldn't make a database check fail.
Suggestions
- Downgrade
Select_full_jointo a notice, as #1167 did forJoin_without_index_rate. It's the same kind of counter, and an admin can't act on it. - Or take a baseline of
Select_full_joinbefore the schema checks run and leave their contribution out.
The same introspection also adds 12 on-disk temp tables per Overview visit, which feeds Created_tmp_disk_tables; that's covered in #1224.
Related: #1155, #1166, #1167, #1224, #1231
- Ngôn ngữ chính
- JavaScript
- Star
- 133
- Fork
- 67
- Merge trung bình
- 22 giờ 55 phút
- Pull request đã merge (30 ngày)
- 53
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của nextcloud/serverinfo
-
Database checks: ∞% reported as Failing when counter is zero; no way to acknowledge/mute a checkĐang mở0. Needs triage bug
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
nextcloud/serverinfo#1231 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
0. Needs triage enhancement
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
nextcloud/serverinfo#1248 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
1. to develop bug
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
nextcloud/serverinfo#1224 · 5 bình luận · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
0. Needs triage bug
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 55/100
nextcloud/serverinfo#1223 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
0. Needs triage bug
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 55/100
nextcloud/serverinfo#1221 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của nextcloud/serverinfo
Issue tương tự
-
Add: OnTime Sports SD LogoĐang mởcheck:failed logos:add
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 67/100
iptv-org/database#38874 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 4 ngày
-
documentation
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
githubnext/gh-aw-workshop#5193 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
-
agent/quality stage/040-covered-by-pr testing
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
cncf/endusers#2031 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày