Answer the question
In order to leave comments, you need to log in
How to reduce the execution time of a t-sql query (optimize) to Oracle?
Good afternoon!
Yes:
MS SQL Server 2012;
Link to Oracle server;
A program that executes similar queries in < 10 seconds.
Required:
Reduce the execution time of the sql query. Tried two options:
1.
SELECT [time],[column1],[column2],[column_N]
from openquery([oracleLink],'SELECT [time],cast([column1] as float) [column1],
cast([column2] as float) [column2],
cast([column_N] as float) [column_N]
FROM [table] WHERE [time] >= ''[time_param]''
and [id]=[int_param] and (COALESCE([column1],[column2],[column_N]) is not null)')
SELECT [time],[column1],[column2],[column_N]
from openquery([oracleLink],'SELECT [time],cast([column1] as float) [column1],
cast([column2] as float) [column2],
cast([column_N] as float) [column_N]
FROM [table] WHERE [time] >= ''[time_param]''
and [id]=[int_param]')
where (COALESCE([column1],[column2],[column_N]) is not null)
Answer the question
In order to leave comments, you need to log in
Look at the profiler what exactly is sent by the program to ms sql, and repeat these queries "manually". Not enough information yet for a more complete answer
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question