Query with parameters very slow with Delphi XE

Discussion of open issues, suggestions and bugs regarding usage of dbExpress drivers for SQL Server in Delphi and C++Builder
Post Reply
wloeppky
Posts: 7
Joined: Fri 18 Jul 2008 17:14

Query with parameters very slow with Delphi XE

Post by wloeppky » Wed 14 Sep 2011 20:08

Delphi XE, using latest DevArt driver. I have found queries that are using paramters are very slow compared to using a plain query with no paramters.

For example"
select * from Tablex where Store = :Store

is way slower than

select * from Tablex where Store = '001'

This was not hapenning in Delphi 7. I did notice using the activity monitor that it is using CONVERT_IMPLICIT for nvarchar paramters. Looks like unicode string are being passed as paramters.

Appreciate any help you can provide.

Wayne

AndreyZ

Post by AndreyZ » Thu 15 Sep 2011 11:42

Hello,

This behaviour is connected with the specificity of SQL Server work. Sometimes small queries with parameters are executed slower than queries without parameters. We cannot influence such SQL Server behaviour.

Post Reply