03eea2098e
- 01~07 작업 문서를 운영 측정값 기준으로 정리 (문서의 DB 비밀번호 삭제) - app_highest_record 중복 8,795행 점수 기준 정리, 인덱스 5개 + UNIQUE 키 2개 추가 - 02·04 공통 측정 스크립트와 측정 결과, comparison.txt 추가 - 서버 처리 시간 18~292배 단축, 결과 행 수 동일 - 운영 데이터 백업과 권한(비밀번호 해시) 파일은 커밋에서 제외 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
48 lines
1.5 KiB
Plaintext
48 lines
1.5 KiB
Plaintext
--------------
|
|
DELETE AHR FROM app_highest_record AHR
|
|
JOIN (
|
|
SELECT AppHighestRecordID FROM (
|
|
SELECT AppHighestRecordID,
|
|
ROW_NUMBER() OVER (
|
|
PARTITION BY MaestroID, PlayerID, AppID
|
|
ORDER BY CASE WHEN AppID = 105 THEN HighestRecord ELSE -HighestRecord END,
|
|
AppHighestRecordID DESC
|
|
) AS rn
|
|
FROM app_highest_record
|
|
) ranked
|
|
WHERE rn > 1
|
|
) dup ON dup.AppHighestRecordID = AHR.AppHighestRecordID
|
|
--------------
|
|
|
|
Query OK, 8795 rows affected (0.942 sec)
|
|
|
|
--------------
|
|
SELECT 'app_highest_record' AS table_name,
|
|
COUNT(*) AS total_rows,
|
|
COUNT(DISTINCT MaestroID, PlayerID, AppID) AS unique_combos
|
|
FROM app_highest_record
|
|
--------------
|
|
|
|
+--------------------+------------+---------------+
|
|
| table_name | total_rows | unique_combos |
|
|
+--------------------+------------+---------------+
|
|
| app_highest_record | 220648 | 220648 |
|
|
+--------------------+------------+---------------+
|
|
1 row in set (0.190 sec)
|
|
|
|
--------------
|
|
SELECT 'typing_exam_highest_record' AS table_name,
|
|
COUNT(*) AS total_rows,
|
|
COUNT(DISTINCT MaestroID, PlayerID, WritingID) AS unique_combos
|
|
FROM typing_exam_highest_record
|
|
--------------
|
|
|
|
+----------------------------+------------+---------------+
|
|
| table_name | total_rows | unique_combos |
|
|
+----------------------------+------------+---------------+
|
|
| typing_exam_highest_record | 20413 | 20413 |
|
|
+----------------------------+------------+---------------+
|
|
1 row in set (0.024 sec)
|
|
|
|
Bye
|