query performance - Multi Thread in SQL? -


i have sql query like

select column1, column2, column3, **ufn_hugetimeprocessfunction**(column1, column2, @param1) column4 table1 

this ufn_hugetimeprocessfunction function run against large table (in terms of number of rows) , there several calculation behind return value.

am able force sql compiler run function in thread (process)?

edited : function data 3 different databases. that's why planing run "in parallel", not possible change indexes on other databases

if server computer on sql server running has multiple cpu's sql server can run single query in parallel using multiple threads. in addition running user queries on multiple processors sql server can use multiple threads build indexes. when examining textual or graphical execution plans notice exchange operators distribute streams, repartition streams , gather streams if query using more 1 processor. typically queries make heavy use of cpu cycles candidates parallel execution. example query joining several large tables , sorting output before returning user benefit parallel execution plan.

in brief, sql server judge of whether query can run in multiple threads or not. query optimizer sees if parts of query can run in parallel , takes call.

if query contains scalar operator or relational operators cannot run in parallel, won't considered parallel execution. furthermore, if number of rows operated on relatively low, query optimizer doesn't consider parallel execution plans.

going words, function time consuming. external select , function running on different threads. however, without visibility ufn_hugetimeprocessfunction, difficult provide solution optimize function parallel runs. in absence of that, recommend have @ execution plan function , see if can tweak query reduce scalar , relational operations

quote source : http://www.toadworld.com/platforms/sql-server/w/wiki/9824.parallel-query-processing.aspx

more info on using parallelism after analyzing execution plans can found @ https://www.simple-talk.com/sql/learn-sql-server/understanding-and-using-parallelism-in-sql-server/


Comments

Popular posts from this blog

google api - Incomplete response from Gmail API threads.list -

Installing Android SQLite Asset Helper -

Qt Creator - Searching files with Locator including folder -