perf(core): 대용량 목록 상한 총 건수·커서 계약 신설 및 요청당 반복 실행 비용 정리

공개 이슈 gnuboard/g7 이 지목한 병목은 "같은 일을 반복 실행한다" 축이다.
응답·행의 무게를 다룬 · 과 겹치지 않는다.

공통 계약 — 총 건수 상한과 페이지 이동 범위는 별개 결정이다. 묶으면 필요 없이
기능이 깎인다. 총 건수만 상한을 받고(파생 테이블 COUNT), "다음" 이동은
per_page + 1 실측으로 끝까지 열어 둔다. 계산이 불가능해지는 것은 마지막 페이지
번호 하나뿐이며 그 사실은 last_page: null 이 알린다. 최신순처럼 실제 컬럼으로
정렬하는 목록은 커서로 전환해 깊이와 무관하게 일정 속도로 이동한다. 관련도순은
계산값 정렬이라 커서 키로 쓸 수 없어 offset 을 유지한다.

계약의 입구는 표준 paginate 와 같은 폭이어야 한다. 관계·쿼리 빌더를 받지 못하면
그 좁은 만큼이 그대로 운영 500 이 되고, 실제로 관리자 알림 목록에서 그렇게 터졌다.
응답 조립도 컬렉션마다 손으로 하면 형태가 늘어나는 순간 없는 값을 부르거나 새
필드를 흘리므로, 형태 판정을 paginationMeta 한 곳에 모았다. 표준 paginate
응답은 필드 단위로 이전과 동일하다.

요청당 반복 비용 — 훅 구독마다 남기던 로그 400줄, 요청당 스무 번 넘던 설정 파일
재읽기, 이미 캐시된 목록의 DB 재조회를 없앴다. 권한 판정은 요청 스코프 메모를 두어
화면 요소마다 나가던 조회를 한 번으로 줄였고, 크로스 요청 캐시는 두지 않아 권한
변경이 종전처럼 다음 요청에 반영된다.

검색 질의는 활성 엔진이 만든다. 저장소가 구체 엔진을 지목하면 플러그인이 등록한
엔진은 호출될 기회 자체를 잃고 오류 없이 다른 방식으로 동작한다. 해석기를 두어
활성 엔진에 위임하고, 전문검색이 없는 DBMS 의 부분일치 폴백도 드라이버명 하드코딩
대신 선언형 config 로 옮겼다.

총 건수가 잘린 목록에서 순번을 역산하면 0 과 음수가 나온다. 지어내지 않고 null 을
돌려주며, 그 원칙을 last_page 와 동일하게 적용했다.
This commit is contained in:
HeuJung committed 2026-08-06 11:13:51 +09:00
1 parent 97ab99b7cd
commit 2ae1972a3b
101 files changed
+6160 -322

No files matched your search

+21
View File
@@ -0,0 +1,21 @@
<?php
return [
/*
|--------------------------------------------------------------------------
| List pagination
|--------------------------------------------------------------------------
| Total count accuracy labels and large-result-set notices.
*/
'total_relation' => [
'exact' => 'exact',
'at_least' => 'at least',
],
'total_exact' => ':count results',
'total_at_least' => 'more than :count results',
'result_cap_notice' => 'More than :cap items matched, so the exact total was not counted. You can still move to the next page.',
'refine_query_hint' => 'Narrow your search terms to see the exact total and jump to the last page.',
];
+4
View File
@@ -7,6 +7,9 @@
return [
'empty_keyword' => 'Please enter a search keyword.',
'results_found' => ':count results found.',
'results_found_at_least' => 'More than :count results found.',
'result_cap_notice' => 'More than :cap items matched, so the exact total was not counted. You can still move to the next page.',
'refine_query_hint' => 'Narrow your search terms to see the exact total and jump to the last page.',
'no_results' => 'No results found.',
'view_more' => 'View more',
@@ -16,6 +19,7 @@ return [
'q_max' => 'Search keyword must not exceed 200 characters.',
'page_integer' => 'Page number must be a number.',
'page_min' => 'Page number must be at least 1.',
'page_max' => 'Page number must not exceed :max. Please narrow your search terms.',
'per_page_integer' => 'Items per page must be a number.',
'per_page_min' => 'Items per page must be at least 1.',
'per_page_max' => 'Items per page must not exceed 100.',
+8
View File
@@ -906,6 +906,14 @@ return [
'sql_query_log_required' => 'Please select the SQL query log setting.',
'sql_query_log_boolean' => 'SQL query log must be true or false.',
// List limits
'pagination_result_cap_integer' => 'The total count cap must be a number.',
'pagination_result_cap_min' => 'The total count cap must be at least :min. (0 = unlimited)',
'pagination_result_cap_max' => 'The total count cap may not be greater than :max.',
'pagination_max_page_integer' => 'The maximum page number must be a number.',
'pagination_max_page_min' => 'The maximum page number must be at least :min. (0 = unlimited)',
'pagination_max_page_max' => 'The maximum page number may not be greater than :max.',
// Core update settings
'core_update_github_url_invalid' => 'The GitHub repository URL format is invalid.',
'core_update_github_url_max' => 'The GitHub repository URL may not be greater than 500 characters.',
+23
View File
@@ -0,0 +1,23 @@
<?php
return [
/*
|--------------------------------------------------------------------------
| 목록 페이지네이션
|--------------------------------------------------------------------------
| 총 건수 정확도 표기와 대용량 목록 안내 문구입니다.
*/
'total_relation' => [
'exact' => '정확',
'at_least' => '이상',
],
// 건수 표기 — 상한 이하일 때는 정확한 건수, 초과할 때는 "이상"
'total_exact' => '총 :count건',
'total_at_least' => '총 :count건 이상',
// 상한 초과 안내 — 검색어를 좁히면 정확한 건수를 볼 수 있다
'result_cap_notice' => '일치하는 항목이 :cap건을 넘어 총 건수를 정확히 세지 않았습니다. 다음 페이지로 계속 이동할 수 있습니다.',
'refine_query_hint' => '검색어를 더 구체적으로 입력하면 정확한 건수와 마지막 페이지를 볼 수 있습니다.',
];
+4
View File
@@ -7,6 +7,9 @@
return [
'empty_keyword' => '검색어를 입력해주세요.',
'results_found' => ':count건의 검색 결과를 찾았습니다.',
'results_found_at_least' => ':count건 이상의 검색 결과를 찾았습니다.',
'result_cap_notice' => '일치하는 항목이 :cap건을 넘어 총 건수를 정확히 세지 않았습니다. 다음 페이지로 계속 이동할 수 있습니다.',
'refine_query_hint' => '검색어를 더 구체적으로 입력하면 정확한 건수와 마지막 페이지를 볼 수 있습니다.',
'no_results' => '검색 결과가 없습니다.',
'view_more' => '더보기',
@@ -16,6 +19,7 @@ return [
'q_max' => '검색어는 최대 200자까지 입력 가능합니다.',
'page_integer' => '페이지 번호는 숫자여야 합니다.',
'page_min' => '페이지 번호는 1 이상이어야 합니다.',
'page_max' => '페이지 번호는 :max 이하여야 합니다. 검색어를 더 구체적으로 입력해 주세요.',
'per_page_integer' => '페이지당 항목 수는 숫자여야 합니다.',
'per_page_min' => '페이지당 항목 수는 1 이상이어야 합니다.',
'per_page_max' => '페이지당 항목 수는 최대 100개까지 가능합니다.',
+8
View File
@@ -989,6 +989,14 @@ return [
'sql_query_log_required' => 'SQL 쿼리 로그 설정을 선택해주세요.',
'sql_query_log_boolean' => 'SQL 쿼리 로그는 true 또는 false 값이어야 합니다.',
// 목록 한계값
'pagination_result_cap_integer' => '총 건수 집계 상한은 숫자여야 합니다.',
'pagination_result_cap_min' => '총 건수 집계 상한은 :min 이상이어야 합니다. (0 = 무제한)',
'pagination_result_cap_max' => '총 건수 집계 상한은 :max 를 초과할 수 없습니다.',
'pagination_max_page_integer' => '페이지 번호 상한은 숫자여야 합니다.',
'pagination_max_page_min' => '페이지 번호 상한은 :min 이상이어야 합니다. (0 = 무제한)',
'pagination_max_page_max' => '페이지 번호 상한은 :max 를 초과할 수 없습니다.',
// 코어 업데이트 설정
'core_update_github_url_invalid' => 'GitHub 저장소 URL 형식이 올바르지 않습니다.',
'core_update_github_url_max' => 'GitHub 저장소 URL은 500자를 초과할 수 없습니다.',