Long queries in general may cause problems, and almost always there's a shorter and better way to handle the problem. Some sqlite APIs also have to do recursive work that may be really expensive on large queries. We should probably use sqlite3_limit(db, SQLITE_LIMIT_SQL_LENGTH, 250000) or a smaller value. But first we need to support binding arrays for IN clauses, so we can remove IN usage
note it would be nice to have telemetry about queries length, before doing this.