Slow String field Select - what's responsible?

Hello!

I have got two simple SQL statements:

SELECT
companyname,
uidnumber,
description,
telephone
FROM
companies
WHERE
entrykey = ?
;

Query Parameter Value(s) -
Parameter #1(cf_sql_varchar) = 2405961E-FE08-E3BE-059C648DC01198A9

SELECT
LEFT(companyname, 250) AS companyname,
LEFT(uidnumber, 100) AS uidnumber,
LEFT(description, 250) AS description,
LEFT(telephone, 100) AS telephone
FROM
companies
WHERE
entrykey = ?
;

Query Parameter Value(s) -
Parameter #1(cf_sql_varchar) = 2405961E-FE08-E3BE-059C648DC01198A9

Both return the same result, but the second one only take 1 msec, the first one 30 msec. The number of chars to return (using LEFT) is exactly the length of the field (no data is shortend). What could be the reason for that difference? Any methods to make query #1 as fast as query #2?

system: JDBC 5.0 / myISAM tables with UTF-8 encoding / CFMX7 app server

Best regards,

Peter

What indexes do you have on the tables?

I wonder if by explicitly stating the length of the string, the optimizier can be sure it can get that data from the index, and doesnt need to goto toe actual data. Without the length it doesnt know that for sure and has to check anyway.

If you can I guess the Explain output for the two queries would be helpful.