Performance of Inserts

Discussion of open issues, suggestions and bugs regarding LinqConnect – Devart's LINQ to SQL compatible ORM
Post Reply
davidaustin
Posts: 1
Joined: Wed 22 Jun 2016 18:15

Performance of Inserts

Post by davidaustin » Wed 22 Jun 2016 18:25

When inserting data into our tables LinqConnect creates code which follows the following pattern

INSERT INTO dbo.table (colNames)
VALUES (@p1);
SELECT rowid FROM dbo.table WHERE rowid = SCOPE_IDENTITY();

We are concerned about the performance of the Select statement. Is there are reason it is not just doing a "Select SCOPE_IDENTITY();" ?

Our database is becoming a bottle neck in our application and we need all the performance we can out of it.

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Re: Performance of Inserts

Post by Shalex » Tue 28 Jun 2016 10:53

Thank you for your suggestion. We will optimize the SQL generation when only one property is Auto-Sync=OnInsert and notify you about the result.

The current SQL template is used to unify the generation. For example, if there would be two or more Auto-Sync=OnInsert properties, the SQL would be the following:
SELECT rowid, Property2, Property3, ... FROM dbo.table WHERE rowid = SCOPE_IDENTITY();

Post Reply