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.) |