Communiquez avec les autres et partagez vos connaissances professionnelles

Inscrivez-vous ou connectez-vous pour rejoindre votre communauté professionnelle.

Suivre

What happens if an application sends Adhoc queries to SQL server continuously, without defining parameters data type and it's size?

 Is there any settings to improve adhoc query performance in SQL server?  Will it leads to SQL server memory leakage?

user-image
Question ajoutée par Utilisateur supprimé
Date de publication: 2016/04/04
Belal AL-Hifawi
par Belal AL-Hifawi , Technical Team leader , PIONEERS TECH SOFT

If you specify correctly (type, size, precision and scale) of your parameters, the SQL Optimizer could reuse your query without rebuilding query plan.

If you don't specify, SQL will create many different queries in the plan cache as you have different string lengths and will avoid the optimization.

Rizwan Afgan
par Rizwan Afgan , SQL Server Administrator / Developer , Oracas (Pvt) Ltd

Parameterized query will definitely improve query processing performance. However, query without parameters will take more time and in case of many queries, bottlenecks may be created.

You can improve the performance of SQL Server by carefully designing your query with performance factor in mind. Implement indexes, test your queries for performance and in NO case query more data then needed. 

 

More Questions Like This

Avez-vous besoin d'aide pour créer un CV ayant les mots-clés recherchés par les employeurs?