On Nov 2, 1:58 pm, Gary Doades <[email protected]> wrote: > As a follow up to my issue 311 report I've produced a crude benchmark > for insert on SQL Server 2008 both with and without the OUTPUT clause. > The code below inserts 1000 records in a transaction and records the > time with and without the OUTPUT clause. > > Using jruby 1.5.3 on Windows 7 > > Benchmark.measure output: > Using OUTPUT: > 2.356000 0.000000 2.356000 ( 2.356000) > Using SCOPE_IDENTITY: > 3.510000 0.000000 3.510000 ( 3.510000) > > The difference is less marked when going over the network rather then > using localhost. > > Using OUTPUT: > 2.940000 0.000000 2.940000 ( 2.940000) > Using SCOPE_IDENTITY: > 3.720000 0.000000 3.720000 ( 3.720000) > > Using the output clause is clearly faster, but not astonishingly so. > In a real world program it's likely to make only a small difference, > unless your program does do many times more inserts than other > operations. Personally I would like to make the use of the OUTPUT > clause an option and not the default thereby making the default > compatible with virtually any database. Turning on the OUTPUT clause > could be an option if you have one of those programs where the > difference would be significant.
Using OUTPUT is almost 50% faster for localhost and over 25% faster over the network, which is a large enough that enabling it by default seems to be worth it. While the average web application is SELECT- heavy, Sequel is used for a lot more than just web applications. I've heard of numerous cases where people are using Sequel to bulk insert into a database, where a 25-50% performance regression would be noticeable and undesired. Is anyone else having problems caused by using the OUTPUT clause by default? Does anyone have an opinion on this one way or the other? Jeremy -- You received this message because you are subscribed to the Google Groups "sequel-talk" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/sequel-talk?hl=en.
