Comments - Index differences between the statemens "equal" and "between" in left join

1 year, 9 months ago Luigi Iemma

Hello, I realized that if my query looks like this: SELECT * FROM TABLE2 WHERE id BETWEEN 1 AND 10009 it works, but it is not optimized when the BETWEEN is in a JOIN or SUBQUERY.

I also tried to create a function that seems to me to be the best system: CREATE FUNCTION CP2 (iNum1 INT, iNum2 INT) RETURNS bigint (20) LANGUAGE SQL DETERMINISTIC BEGIN RETURN iNum1 * 10000 + iNum2; END but even so the BETWEEN is not optimized.

Thank you very much for the attention you will want to give me.

Luigi.

 
Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.