April 21, 2010 at 5:01 am
Which is faster
Insert/Delete/Update/Select
how ?
Which is Slower
Insert/Delete/Update/select
why ?
Thanks
Parthi
Thanks
Parthi
April 21, 2010 at 6:44 am
parthi-1705 (4/21/2010)
Which is fasterInsert/Delete/Update/Select
how ?
Which is Slower
Insert/Delete/Update/select
why ?
well... it all depends of what you are trying to accomplish... if you want to add a new row to a table insert will be the faster way while delete/update/select will be much slower... like you will never get there 😀
Now, seriously - research locking and t-log generation.
_____________________________________
Pablo (Paul) Berzukov
Author of Understanding Database Administration available at Amazon and other bookstores.
Disclaimer: Advice is provided to the best of my knowledge but no implicit or explicit warranties are provided. Since the advisor explicitly encourages testing any and all suggestions on a test non-production environment advisor should not held liable or responsible for any actions taken based on the given advice.April 21, 2010 at 6:59 am
There really is no hard and fast rule on this because you're comparing apples to hammers. If you have to delete a row, what would it matter if the delete operation was faster than inserting a row? If you have to select a row, what would it matter that it's slower than updating a row? That's before you get into trying to compare the select of 1000 rows against the insert of 1... You just can't quantify this information in a way that's meaningful.
The shortest approach is to say that anything that involves writes is slower, so delete/update/insert are slower than select. But, then you get into another issue, what happens when the select has operators that need to store data in tempdb. Then the select is actually doing writes too.
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
- Theodore Roosevelt
Author of:
SQL Server Execution Plans
SQL Server Query Performance Tuning
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply