Is there's another function to optimize this query in MySQL?
You can use a regular expression to match '1 ' to '6 ' at the beginning of the string:

data.pro rlike '^([1-6] )'


Now put this in a CASE:

case when data.pro rlike '^([1-6] )' 
     then cast(substring(data.pro from 1 for 1) as unsigned)
end


See the result in MySQL 5.5 on SQLFiddle.