November 22, 2017 at 10:01 am
Hello experts,
Is there a free or a paid tool/software that can be used to provide t-sql recommendations or that can provide corrections to the t-sql statement to optimize the code for e.g see below...suggesting some changes to use "in" instead of "exists". I knew of a tool that was used to do this in the past and it was "Lecco SQL Expert". However, this isn't available anymore. Is there an alternative SQL tool that can be a paid tool or free which can do this.
SELECT
some_data
FROM details_table D
WHERE EXISTS (SELECT
1
FROM lookup_table L
WHERE L.lookup_column = D.lookup_column
AND L.matching_column = 'Yes')
can be written asSELECT /*+ FIRST_ROWS */
some_data
FROM details_table D
WHERE lookup_column IN (SELECT
L.lookup_column
FROM lookup_table L
WHERE L.matching_column = 'Yes')
November 22, 2017 at 11:18 am
Quest bought them out years ago. I'm not sure if it's related to the SQL Optimizer product that Quest has.
SQL Optimizer does do the alternative sql statements you mention and benchmarks the alternatives. You might want to see if they have a trial version to test.
Sue
November 22, 2017 at 11:37 am
Sue_H - Wednesday, November 22, 2017 11:18 AMQuest bought them out years ago. I'm not sure if it's related to the SQL Optimizer product that Quest has.
SQL Optimizer does do the alternative sql statements you mention and benchmarks the alternatives. You might want to see if they have a trial version to test.Sue
I am not sure if I can buy a license for that. I went through their portal and I couldn't find that. I think I might have to call their sales team for this. Any other alternatives?
November 22, 2017 at 11:48 am
ffarouqi - Wednesday, November 22, 2017 11:37 AMSue_H - Wednesday, November 22, 2017 11:18 AMQuest bought them out years ago. I'm not sure if it's related to the SQL Optimizer product that Quest has.
SQL Optimizer does do the alternative sql statements you mention and benchmarks the alternatives. You might want to see if they have a trial version to test.Sue
I am not sure if I can buy a license for that. I went through their portal and I couldn't find that. I think I might have to call their sales team for this. Any other alternatives?
I just did a search on: SQL Optimizer Quest
and the download link was right there.
SQL Optimizer for SQL Server - Download Software
And then when I pulled out the word Quest and just had SQL Optimizer, it provided links to other tools. You may want to try searching on that and trying some of those other options.
Sue
November 22, 2017 at 12:06 pm
Sue_H - Wednesday, November 22, 2017 11:48 AMffarouqi - Wednesday, November 22, 2017 11:37 AMSue_H - Wednesday, November 22, 2017 11:18 AMQuest bought them out years ago. I'm not sure if it's related to the SQL Optimizer product that Quest has.
SQL Optimizer does do the alternative sql statements you mention and benchmarks the alternatives. You might want to see if they have a trial version to test.Sue
I am not sure if I can buy a license for that. I went through their portal and I couldn't find that. I think I might have to call their sales team for this. Any other alternatives?
I just did a search on: SQL Optimizer Quest
and the download link was right there.
SQL Optimizer for SQL Server - Download SoftwareAnd then when I pulled out the word Quest and just had SQL Optimizer, it provided links to other tools. You may want to try searching on that and trying some of those other options.
Sue
I tried creating a trial account but it says that I haven't purchased this product and need to contact customer service and there is no trial download available for this. I will have to speak to someone over there in order to get a trial link.
November 22, 2017 at 2:42 pm
ffarouqi - Wednesday, November 22, 2017 10:01 AMHello experts,Is there a free or a paid tool/software that can be used to provide t-sql recommendations or that can provide corrections to the t-sql statement to optimize the code for e.g see below...suggesting some changes to use "in" instead of "exists". I knew of a tool that was used to do this in the past and it was "Lecco SQL Expert". However, this isn't available anymore. Is there an alternative SQL tool that can be a paid tool or free which can do this.
SELECT
some_data
FROM details_table D
WHERE EXISTS (SELECT
1
FROM lookup_table L
WHERE L.lookup_column = D.lookup_column
AND L.matching_column = 'Yes')
can be written asSELECT /*+ FIRST_ROWS */
some_data
FROM details_table D
WHERE lookup_column IN (SELECT
L.lookup_column
FROM lookup_table L
WHERE L.matching_column = 'Yes')
As a bit of a sidebar, if the lookup column on the lookup table is unique and has an index on it, both of the methods might suck compare to a good ol' fashioned INNER JOIN. If you need to be able to answer "No" when not found, then both will be better than an outer join and, depending on the data and table structure, could be a tie with each other for performance.
I guess my question here is... you seem to have some practical knowledge... why not just do the test yourself instead of using software that you'd have to test the recommendations of anyway?
--Jeff Moden
Change is inevitable... Change for the better is not.
January 23, 2018 at 9:46 am
Jeff Moden - Wednesday, November 22, 2017 2:42 PMffarouqi - Wednesday, November 22, 2017 10:01 AMHello experts,Is there a free or a paid tool/software that can be used to provide t-sql recommendations or that can provide corrections to the t-sql statement to optimize the code for e.g see below...suggesting some changes to use "in" instead of "exists". I knew of a tool that was used to do this in the past and it was "Lecco SQL Expert". However, this isn't available anymore. Is there an alternative SQL tool that can be a paid tool or free which can do this.
SELECT
some_data
FROM details_table D
WHERE EXISTS (SELECT
1
FROM lookup_table L
WHERE L.lookup_column = D.lookup_column
AND L.matching_column = 'Yes')
can be written asSELECT /*+ FIRST_ROWS */
some_data
FROM details_table D
WHERE lookup_column IN (SELECT
L.lookup_column
FROM lookup_table L
WHERE L.matching_column = 'Yes')As a bit of a sidebar, if the lookup column on the lookup table is unique and has an index on it, both of the methods might suck compare to a good ol' fashioned INNER JOIN. If you need to be able to answer "No" when not found, then both will be better than an outer join and, depending on the data and table structure, could be a tie with each other for performance.
I guess my question here is... you seem to have some practical knowledge... why not just do the test yourself instead of using software that you'd have to test the recommendations of anyway?
Unfortunately, my experience on T-SQL side is very minimal and somehow code logic is not something that I am really good at...hence the need. In case if I ask someone in the forum to help me out with a problem that I am struggling with they would come back and say that we aren't paid to help you fix the code which is understandable but what other means do I have if there is no help and I can't do it myself....not every DBA is exceptional in T-SQL.
January 23, 2018 at 10:04 am
I never used it, you can try and let us know.
January 23, 2018 at 10:07 am
goher2000 - Tuesday, January 23, 2018 10:04 AMI never used it, you can try and let us know.
Sure. I will try and let it know.
Viewing 9 posts - 1 through 8 (of 8 total)
You must be logged in to reply to this topic. Login to reply