speed of select

Forum related to version 6.5.1 (alpha) and 6.6.x (beta) of ZeosLib's DBOs

Moderators: gto, cipto_kh, EgonHugeist

jrmarino
Fresh Boarder
Fresh Boarder
Posts: 19
Joined: 04.01.2006, 22:37

Post by jrmarino »

The zeos-derivative Pascal Data Objects ( http://seegernet.koolhost.de/zeosforum/ ... =1714#1714 ) doesn't suffer from this internal slowness. It uses only the mysql native calls, meaning it can return the entire rowset and the number of rows in the result set (as opposed to leaving on the server and continuously requesting another row)

If you are using MySQL 4.1 and 5.0, and you are really concerned about speed, you might want to check it out.

I'd be interested to know how it compares performance wise to the same query!
killerjohn
Fresh Boarder
Fresh Boarder
Posts: 22
Joined: 23.11.2005, 09:19

Post by killerjohn »

WOW!

BindColumn rulez :) i'm not tested yet, but i'll :) :) :) thank you very much!
killerjohn
Fresh Boarder
Fresh Boarder
Posts: 22
Joined: 23.11.2005, 09:19

Post by killerjohn »

I've found a bug - StrToFloat doesn't work on NULL values... StrToFloatDef is a better choice...

function TMysqlResult.asExtended: Extended;
Begin
Result := StrToFloatDef(self.FRawString,0);
End;

function TMysqlResult.asDouble: Double;
var
full64: Extended;
Begin
full64 := StrToFloatDef(self.FRawString,0);
Result := full64; {overflow problem/typecast doesn't work?}
End;

function TMysqlResult.asSingle: Single;
var
full64: Extended;
Begin
full64 := StrToFloatDef(self.FRawString,0);
Result := full64; {overflow problem/typecast doesn't work?}
End;
jrmarino
Fresh Boarder
Fresh Boarder
Posts: 19
Joined: 04.01.2006, 22:37

Post by jrmarino »

Thanks, I'll take a look and likely update via subversion.


added: Okay, I made your suggested changes verbatim, and now they are available as revision 8. Thanks again for the feedback.
donadoni
Fresh Boarder
Fresh Boarder
Posts: 1
Joined: 13.03.2006, 10:16

Post by donadoni »

I'm using PostgreSQL 7.x and Zeos 6.1.5 (alpha). Where I Execute a SQL statement bellow, it so slowly, take about 31 seconds, while I use PHP, It only take ~ 15seconds.
...
var
w_Sql: String;
begin
w_Sql:= 'SELECT a.send_del_flag, a.send_id,b.* ' +
'FROM tbl_send_report_daily a , tbl_report_daily b ' +
'WHERE a.per_reply_id = ''' + wg_userlogin + ''' ' +
'AND trim(a.re_id) = trim(b.re_id) ' +
'ORDER BY a.send_del_flag, a.send_id desc';

with DmIAi.ZQuery1 do
begin
if Active then Close;
SQL.Clear;
SQL.Text:= w_Sql;
try
Open; //
Result:= RecordCount;
except
result:= -1;
end;
end;

There are 9479 records in tbl_send_report_daily
and 3778 records in tbl_reply_report_daily.

Can you help me!!!!
Post Reply