-1

In my mvc application, i used Linq to perform my database interactions. I found it really awesome. Linq queries are compact than ordinary Sql queries. But my doubt is that does the Linq can perform database operations faster than Sql and why ?

Kcvin
  • 5,073
  • 2
  • 32
  • 54
BPX
  • 888
  • 1
  • 8
  • 20

1 Answers1

6

No, it cannot perform database operations faster than SQL, because it uses SQL!

Your query is transformed into proper SQL statement, which is then sent to database and after results are retrieved they are transformed by into more developer-friendly objects, collections, etc.

And because you don't have 100% control on how the SQL which is generated looks like it's quite common to get not fully optimized SQL, especially for complex and complicated queries.

MarcinJuraszek
  • 124,003
  • 15
  • 196
  • 263
  • Nice answer. I have another doubt that does linq work with Oracle database ? – BPX Jan 17 '14 at 06:54
  • @BPX Did you try searching for an answer on that question? There are plenty already, like that one: http://stackoverflow.com/questions/4276495/using-linq-to-sql-with-oracle – MarcinJuraszek Jan 17 '14 at 06:55
  • I saw the answers. But i already have an application in which linq queries are already written using entity framework. Can i use any other database instead of Sql server just by changing connection string ? – BPX Jan 17 '14 at 07:00
  • 1
    If you already uses Entity Framework you can just change the provided and DB access data within connection string and it should work. – MarcinJuraszek Jan 17 '14 at 07:02