Experiment Detail
MySQL Performance Monitoring
2026. 11. 18.
● System ReadyExperiment Detail Information
임의의 고객이 특정 년도에 주문한 내역 조회
인덱스 적용 전후 비교
SQL Query
Query 7
select * FROM orders
where customer_id = 52
and order_date between '2025-01-01' and '2025-12-31';
Index Condition
Registered Index Conditions
Query 7 - Condition 18
인덱스 미적용
Query 7 - Condition 19
인덱스 적용
테이블명: orders
인덱스명: idx_orders_order_date
인덱스 컬럼: order_date
Query 7
| 구분 | 평균 실행 시간 | 중앙값 |
|---|---|---|
| Before | 0.43 ms | 0.43 ms |
| After (Condition 19) | 0.46 ms | 0.46 ms |
Query 7
| 구분 | 1회차 | 2회차 | 3회차 | 4회차 | 5회차 |
|---|---|---|---|---|---|
| Before | 0.48 ms | 0.44 ms | 0.42 ms | 0.43 ms | 0.41 ms |
| After (Condition 19) | 0.46 ms | 0.48 ms | 0.47 ms | 0.45 ms | 0.42 ms |
Query 7
Before
EXPLAIN
orders
접근 방식 (type)
ref
선택 인덱스 (key)
fk_orders_customer_idx
예상 행 수 (rows)
12
필터 비율 (filtered)
11.11%
상세 실행 계획 정보
SELECT ID (id)
1
SELECT 유형 (select_type)
SIMPLE
파티션 (partitions)
없음
인덱스 길이 (key_len)
4
참조 값 (ref)
const
가능한 인덱스 (possible_keys)
fk_orders_customer_idx
추가 정보 (Extra)
Using where
EXPLAIN ANALYZE
-> Filter: (orders.order_date between '2025-01-01' and '2025-12-31') (cost=3.13 rows=1.33) (actual time=1.24..1.24 rows=5 loops=1)
-> Index lookup on orders using fk_orders_customer_idx (customer_id=52) (cost=3.13 rows=12) (actual time=0.0337..0.0407 rows=12 loops=1)
After (Condition 19)
EXPLAIN
orders
접근 방식 (type)
ref
선택 인덱스 (key)
fk_orders_customer_idx
예상 행 수 (rows)
12
필터 비율 (filtered)
41.83%
상세 실행 계획 정보
SELECT ID (id)
1
SELECT 유형 (select_type)
SIMPLE
파티션 (partitions)
없음
인덱스 길이 (key_len)
4
참조 값 (ref)
const
가능한 인덱스 (possible_keys)
fk_orders_customer_idx,idx_orders_order_date
추가 정보 (Extra)
Using where
EXPLAIN ANALYZE
-> Filter: (orders.order_date between '2025-01-01' and '2025-12-31') (cost=3.5 rows=5.02) (actual time=0.0395..0.0435 rows=5 loops=1)
-> Index lookup on orders using fk_orders_customer_idx (customer_id=52) (cost=3.5 rows=12) (actual time=0.0352..0.0377 rows=12 loops=1)