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!
speed of select
Moderators: gto, cipto_kh, EgonHugeist
-
- Fresh Boarder
- Posts: 22
- Joined: 23.11.2005, 09:19
-
- Fresh Boarder
- Posts: 22
- Joined: 23.11.2005, 09:19
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;
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;
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!!!!
...
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!!!!