query performance problem

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
namikgungor
Posts: 2
Joined: Wed 03 Jun 2009 18:08

query performance problem

Post by namikgungor » Sat 25 Sep 2010 12:09

i am using postgresql.
vhastakayit is view.

UniQuery1.SQL.Clear;
UniQuery1.SQL.Add('select * from udr.vhastakayit where protokolno>:protokolno');
UniQuery1.Params.ParamByName('protokolno').Value:=4000000;
UniQuery1.Open;

8 seconds

UniQuery1.SQL.Clear;
UniQuery1.SQL.Add('select * from udr.vhastakayit where protokolno>=:4000000 ');
UniQuery1.Open;

2 seconds

why can be happend different performance as when i send parameter?

Thanks.

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Post by AlexP » Mon 27 Sep 2010 07:24

Hello,

I tested your example, and difference between a query with param and without it was ~0.01 sec. I have tested it on 1000000 records.

Please tell me your exact version of UniDAC and send me script to create the table, and the number of records in the table to alexp*devart*com.

Also if you don't use default TUniQuery settings, please send me your settings, or send a small project to demonstrate the problem.

Post Reply