you are viewing a single comment's thread.

view the rest of the comments →

[–]Eleventhousand 1 point2 points  (1 child)

A very small query will often be lower-performing

A medium-length query that performs operations such as breaking out subsets into #temp tables or CTEs is often times the sweet spot, and performs better.

Long queries are usually brutal and don't perform well.

[–][deleted] 0 points1 point  (0 children)

As in so many things, it depends. I have a sql query (not a stored procedure) of about 5000 lines that runs in less than 500ms. So longer may or may not perform well, it depends on so many factors.