jaymc Posted August 3, 2007 Share Posted August 3, 2007 Is there any point putting a LIMIT on an insert Obviously the data is only going to be inserted once, but for performance is it better adding LIMIT 1 at the end? Thanks! Quote Link to comment Share on other sites More sharing options...
Tyche Posted August 4, 2007 Share Posted August 4, 2007 Strictly speaking the INSERT command does not recognise LIMIT and a INSERT ... SET col=... LIMIT 1 will fail as will INSERT ... VALUES (...),(...) LIMIT 2 command You can use LIMIT on an INSERT .... SELECT ... Command but there the LIMIT is an optional part of the SELECT command component, its use here should improve performance in many cases Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.