I have activated slow logs in mysql 5.7.30. I notice some SP's calls are not highlighting in slow logs even its taking more then time to my threshold value which is 2-sec. On investigation, I found the calls which are using temporary tables are not highlighting into slow logs eg below query taking 30-sec but this SP is not highlighting into slow logs:
INSERT INTO temp_media(pacs_media_id, pacs_users_id)
SELECT p.id, pu.id
FROM media p
INNER JOIN users pu ON pu.token_client_id=p.token_client_id
AND pu.token_location_id=p.token_location_id
AND pu.user_ref_id=p.entity_ref_id
-- AND pu.token_client_id IN (812,525, 141,44,69) -- 1104
INNER JOIN clients pc ON pc.token_client_id=pu.token_client_id
AND pc.is_active=1
-- AND pc.process_id=p_process_id
AND FIND_IN_SET(pu.user_type, pc.user_types)
AND pu.user_type IS NOT NULL
WHERE p.entity_name_id=1 -- 1: users
AND p.is_processed=0
-- AND p.id % p_thread_total=p_thread_no
LIMIT 100