According to the answer to this question: What is maximum query size for mysql?
The max value is shown in bytes and not characters, so I can't decide when the time to split the query is. Would be even better if I could check that while the query is still a string in php since its length will be flexible.