No, that is not the only option. There may be others, but depends on how you are performing inserts. Others options, but not limited to, may be:
1. If you have auto_commit on, bundle up your inserts in a transaction.
2. Do bulk inserts instead of each one as a separate one, like insert into ... values(a,b,c), (d,e,f), ....,(x,y,z);
3. Reset your global variables depending on your server's performance - I know this is a very generic and weird statement, but cannot elaborate until provided with the details.
Thanks & Regards,
Parvesh Garg
http://optimmysql.blogspot.com
-------------------------------
"Language shapes the way we think, and determines what we can think about."
-- B. L. Whorf