MySQL Forums
Forum List  »  General

Re: Sargable Custom Functions in Queries
Posted by: David Allen
Date: December 05, 2021 03:27PM

Thanks, John! Sadly, it looks like I won't be able to do what I want as I use custom internal functions. Blows my mind MySQL doesn't allow the enforcement of a function as truly DETERMINISTIC (and thus static) as a function.

For example:

SELECT * FROM table t1 WHERE t1.row_val = get_val('OBJECT','STATIC');

Where get_value queries the values from our own database. What's sad is if I put the actual SELECT from get_val into the query, it's Sargable.

No idea why they even have DETERMINISTIC in a function if it's never treated as such in a query :(

Options: ReplyQuote


Subject
Written By
Posted
Re: Sargable Custom Functions in Queries
December 05, 2021 03:27PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.