Sample Header Ad - 728x90

Forcing a LIMIT to MySQL Queries using ProxySQL, QueryRewrite, or some other method

1 vote
1 answer
626 views
I have a system that end users will need to query but they are not guaranteed to be well versed in query writing. We wanted to ensure every SELECT statement ends with a LIMIT 100000. I have thought of some regex to do this and some tools. It seems the native Query Rewrite is a good option but we needed to use ProxySQL for other things, thus I wanted to see if anyone knows of a way to force this. It seems like the patter or regex would be something like: anything that starts with select needs to have a LIMIT on the final line followed by a space and int equal to or less than 100000 then maybe a semi colon. Has anyone had any luck doing this?
Asked by Ali Razeghi - AWS (7576 rep)
Jul 17, 2018, 11:46 PM
Last activity: Jul 18, 2018, 10:41 PM