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