본문으로 건너뛰기
Skillpedia
데이터베이스9.5k · #12278

detect_fragmented_tables

하는 일

이 스킬은 쓰이지 않는 공간을 안고 있는 MySQL과 MariaDB 테이블을 찾고, 되찾을 수 있는 용량을 추정합니다. 저장 공간 사용을 안전하게 줄이려는 데이터베이스 관리자를 위한 것입니다.

사용하는 경우

  • ✓데이터베이스 디스크가 차고 있어서 낭비가 어디인지 알고 싶을 때.
  • ✓테이블에 되찾을 수 있는 빈 공간이 많을 때.
  • ✓유지 보수를 계획하면서 서버에 영향을 줄 만큼 큰 테이블을 알아야 할 때.

스킬 링크

https://github.com/major/MySQLTuner-perl/blob/master/.agent/skills/detect-fragmented-tables/SKILL.md

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/major/MySQLTuner-perl/blob/master/.agent/skills/detect-fragmented-tables/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“제 데이터베이스에서 디스크 공간을 가장 많이 낭비하는 테이블을 찾고, 어떤 것을 안전하게 정리할 수 있는지 알려 주세요.”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

에이전트는 테이블 크기 정보를 읽고, 각 테이블의 빈 공간 비율을 계산해 순위를 매깁니다. 정리 명령을 제안하고, 영향이 큰 큰 테이블은 고영향으로 표시해 계획을 세울 수 있게 합니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.

AI Skill: Table Fragmentation & Storage Reclaim Diagnostics

🧠 Purpose & Operational Objectives

The detect_fragmented_tables skill enables autonomous DBA agents to identify wasted disk space, high data file fragmentation, and unused allocated extents across InnoDB and MyISAM tables.

📋 Preconditions & Context

  • Server running MySQL 5.5+ or MariaDB 10.0+.
  • Read access to information_schema.TABLES.
  • Evaluates non-system schemas (skips mysql, information_schema, performance_schema, sys).

🛠️ Input Parameters

Parameter Type Required Default Description
min_fragmentation_pct number No 20 Minimum fragmentation percentage (0-100) to trigger reporting.
min_table_size_mb number No 10 Minimum table size in MB to filter out trivial tables.
schema_filter string No "" Optional schema name to restrict the scan.

📊 Fragmentation Formula & Impact Scoring

$$\text{Total Allocated Space} = \text{DATA_LENGTH} + \text{INDEX_LENGTH} + \text{DATA_FREE}$$ $$\text{Fragmentation Pct} = \left(\frac{\text{DATA_FREE}}{\text{Total Allocated Space}}\right) \times 100$$

  • Tables $< 5\text{GB}$: Can be defragmented online during low-traffic windows via OPTIMIZE TABLE \db`.`table`;`.
  • Tables $\ge 5\text{GB}$: Flagged as is_high_impact: true. Advise using online tools like pt-online-schema-change or gh-ost to prevent extended table locks and disk thrashing.

🛡️ Guardrails & Safety

  • All schema and table names are safely escaped with backticks to prevent SQL injection.
  • Reclaimable disk space is calculated deterministically.
자주 묻는 질문

스스로 테이블을 정리하나요?

아니요. 보고하고 명령을 제안합니다. 데이터베이스에서 무엇이든 실행하기 전에 직접 검토하면 됩니다.

어떤 테이블은 제외하나요?

mysql, information_schema, performance_schema, sys 같은 시스템 스키마는 검사하지 않습니다.

검사 범위를 좁힐 수 있나요?

네. 최소 단편화 비율과 테이블 크기를 정하거나, 검사를 한 스키마로 제한할 수 있습니다.

상세 정보

작성자의 원본 설명

Detects tables with high storage fragmentation, calculates reclaimable disk space, evaluates lock impact, and generates safe defragmentation commands.

repo: major/MySQLTuner-perl

인기도

GitHub 스타
9.5k
순위
#12278
라이선스
GPL-3.0
업데이트
2026. 10. 28.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬