2011-03-22 4 views

답변

3

당신이 MySQL의에서 저장 프로 시저를 설명 할 수 없다 현재 TABLENAME

9

을 DESCRIBE의 별칭입니다 TABLENAME EXPLAIN 사용하는 경우를 제외하고, 단지 SELECT 문에 작품을 EXPLAIN -하지만 당신은 이런 식으로 뭔가를 할 수을 :

drop procedure if exists get_user; 
delimiter # 
create procedure get_user 
(
in p_user_id int unsigned, 
in p_explain tinyint unsigned 
) 
begin 
    if (p_explain) then 
    explain select * from users where user_id = p_user_id; 
    end if; 
    select * from users where user_id = p_user_id; 
end# 

delimiter ; 

call get_user(1,1); 
16

당신은 실행 계획을 공개하지 않는

set profiling=1; 
call proc_name(); 
show profiles; 
+1

을 시도 할 수 있지만 절차의 각 쿼리에 걸린 시간을 표시한다. – Brandon

관련 문제