Jump to content
Hotmail and Outlook are blocking most of our emails at the moment. Please use an alternative provider when registering if possible until the issue is resolved.

Recommended Posts

Posted

Is trying to insert the data REALLY faster than doing a check? Aren't they both essentially just one database call each? I mean, I can try it to see if that speeds things up, but... I'm skeptical.

I'm out.
Posted

Is trying to insert the data REALLY faster than doing a check? Aren't they both essentially just one database call each? I mean, I can try it to see if that speeds things up, but... I'm skeptical.

 

Well, your mileage may vary, but in my case, I think it depends on how the db server executes the check. We were taking a massive 200+MB csv file and sending each row to the server to be inserted and the query doing the insert had a complicated WHERE clause to check for uniqueness. When we tried the constraint method, it was much faster. Also, if you're going into MySQL instead of SQL Server, it may have a different way of doing things. If I get some time, I'll try to quantify the savings.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...