简体   繁体   中英

Queries - SQL vs. SharePoint

I want to be able to quantify the difference in performance between SQL and SharePoint when executing queries. I know that SQL is faster, but I want some way to quantify this without have to right 2 different applications.

Does anyone know of anyone that has done this? Or does anyone have any links to articles that talk about this? Or do you have your own knowledge/information that explains this?

Since SharePoint is built on SQL Server, you can use SQL Profiler to gather statistics about queries that SharePoint issues and ones that you author yourself. This will show you the execution times of each query. Try copying the query text into SQL Server Management Studio and retrieving the execution plan. This will give you specifics about what parts of the query perform worse than the one you author.

Do this on a test SharePoint server. It is a fun way to learn about how SharePoint works.

There should be no difference in the execution times.

SharePoint issues extremely optimized queries to the SQL database.

The difference is that SQL server just displays the data when you use SSMS, SharePoint still needs to transform that data into something else, like a web service or webpage. This takes a lot more CPU and memory and takes a bit longer compared to simply returning the data.

If you don't believe me then open SQL Profiler, point it to the SharePoint database. Extract the queries and run them in SQL. If you can construct the query better please let me know.

One consideration might be indexes, especially on SharePoint prior to 2013, but that will affect both SQL performance and SharePoint performance on SQL queries.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM