Search
Duplicate
โŒจ๏ธ

profiling ํ•˜๋Š” ๋ฒ•

SELECT @@profiling;
SET profiling = 1;
SET @@profiling_history_size = 100;
SHOW PROFILES;
SHOW PROFILE ALL FOR QUERY 43;
โ†’ ALL ๋ง๊ณ ๋„ CPU/IPC/SOURCE/SWAPS ๋“ฑ์œผ๋กœ ์กฐํšŒ ๊ฐ€๋Šฅ
select state, format(duration, 6) as duration, cpu_user, cpu_system, context_voluntary, context_involuntary from information_schema.profiling where query_id=6;
Theย statistics stateย is where MySQL figures out which indexes to use and which order to join tables in, based on that information. The reason that it is slow is because MySQL has to figure out the optimal order in which to join the tables.
Column Name
Description
QUERY_ID
Query_ID.
SEQ
๋™์ผํ•œย QUERY_ID๋ฅผย ๊ฐ–๋Š”ย ํ–‰์˜ย ํ‘œ์‹œย ์ˆœ์„œ๋ฅผย ๋ณด์—ฌ์ฃผ๋Š”ย ์ผ๋ จย ๋ฒˆํ˜ธ
STATE
ํ”„๋กœํŒŒ์ผ๋งย ์ƒํƒœ
DURATION
๋ช…๋ น๋ฌธ์ดย ํ˜„์žฌย ์ƒํƒœ์—ย ์žˆ์—ˆ๋˜ย ์‹œ๊ฐ„ย (์ดˆ).
CPU_USER
์‚ฌ์šฉ์žย CPUย ์‚ฌ์šฉ๋Ÿ‰ย (์ดˆ)
CPU_SYSTEM
์‹œ์Šคํ…œย CPUย ์‚ฌ์šฉ๋Ÿ‰ย (์ดˆ).
CONTEXT_VOLUNTARY
์ž๋ฐœ์ ย ์ปจํ…์ŠคํŠธย ์ „ํ™˜์˜ย ์ˆ˜. (Number of voluntary context switches.)
CONTEXT_INVOLUNTARY
๋ฌด์˜์‹์ ย ์ธย ์ปจํ…์ŠคํŠธย ์ „ํ™˜์˜ย ์ˆ˜.ย (Number of involuntary context switches.)
BLOCK_OPS_IN
๋ธ”๋กย ์ž…๋ ฅย ์กฐ์ž‘์˜ย ์ˆ˜.ย (Number of block input operations.)
BLOCK_OPS_OUT
๋ธ”๋กย ์ถœ๋ ฅย ์กฐ์ž‘์˜ย ์ˆ˜.ย (Number of block output operations.)
MESSAGES_SENT
์ „์†กย ๋œย ํ†ต์‹ ย ์ˆ˜.ย (Number of communications sent.)
MESSAGES_RECEIVED
์ˆ˜์‹ ย ๋œย ํ†ต์‹ ย ์ˆ˜.ย (Number of communications received.)
PAGE_FAULTS_MAJOR
๋ฉ”์ด์ €ย ํŽ˜์ด์ง€ย ํดํŠธ์˜ย ์ˆ˜.ย (Number of major page faults.)
PAGE_FAULTS_MINOR
๋งˆ์ด๋„ˆย ํŽ˜์ด์ง€ย ํดํŠธ์˜ย ์ˆ˜.ย (Number of minor page faults.)
SWAPS
์Šค์™‘์˜ย ์ˆ˜. (Number of swaps.)
SOURCE_FUNCTION
ํ”„๋กœํŒŒ์ผย ๋œย ์ƒํƒœ๋กœย ์‹คํ–‰๋˜๋Š”ย ์†Œ์Šคย ์ฝ”๋“œ์˜ย ๊ธฐ๋Šฅ.ย (Function in the source code executed by the profiled state.)
SOURCE_FILE
ํ”„๋กœํŒŒ์ผย ๋งย ๋œย ์ƒํƒœ๋กœย ์‹คํ–‰ย ๋œย ์†Œ์Šคย ์ฝ”๋“œ์˜ย ํŒŒ์ผ. (File in the source code executed by the profiled state.)
SOURCE_LINE
ํ”„๋กœํŒŒ์ผย ๋งย ๋œย ์ƒํƒœ๋กœย ์‹คํ–‰ย ๋œย ์†Œ์Šคย ์ฝ”๋“œ์˜ย ํ–‰. (Line in the source code executed by the profiled state.)