Home > Archive > Clipper > January 2006 > set relation much slower with ADS.
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
set relation much slower with ADS.
|
|
| Marcello 2006-01-20, 6:55 pm |
| Hi,
First of all When i was a clipper program I never used set
relation and set filter .
I=B4m trying to make a very old program made by a fake programmer to use
ads.
This will only be used while the next program(written in JAVA) is being
made.
Many things became fast as it was espected but erything
that is realted to the comand set relation became really really slow
and the network traffic increased a lot.
The guy made a set relation and then Applied a filter on it,
I guess ADS is sending the whole table to the client and the clipper
program is then discarding the records by using set filter.
But why it had become so much slower than a pure clipper program?
Can AOF be the solution whitout i have to make changes
in the program "logic"?=20
Regards,=20
Marcello Dias
| |
| Dave P 2006-01-20, 6:55 pm |
| how is the setfilter set
if its for a browse....create a filtertop(),filterskip(),filtergobottom(
)
also create functions
filtergotop(),filterskip(),filtergobotto
m()
filter withing the relation scope
Example Below
/*
Clipper Version 52e
*/
/*
inside Browse Setup a Cargo instance Variable and load it with a Record
Filter Code Block Example {|| field>=Varible }
Call Instance Variable Tb_Filter Translated
Cargo\[36] or any Position in
Cargo. Also Need a cargo pos for Tb_alias Alias Database Browseing.
Cargo\[4]
*/
O=TBROWSE OBJECT The Examples below
o:tb_xxxxx values are just xtranslated O:CARGO
O:CARGO:=ARRAY(30)
#XTRANSLATE TB_POINTER => Cargo\[1]
// ****************************************
***
FUNCTION FltSkipper(NtoSkip,O)
// ****************************************
*
LOCAL newpos:=0
IF NtoSkip == 0
// Skip 0 (significant on a network)
(o:Tb_alias)->(dbskip(0))
Elseif NtoSkip>0 .and. !(o:Tb_ALIAS)->(eof())
// Skip forward
DO WHILE newpos < NtoSkip
(o:Tb_alias)->(dbskip())
if ! (o:Tb_alias)->(Eval(o:Tb_fltrCond))
o:hitbottom:=.t.
(o:Tb_alias)->(dbskip(-1))
o:Tb_pointer:=(o:Tb_alias)->(recno())
exit
endif
if (o:Tb_alias)->(eof())
STUFFKEY("")
o:hitbottom:=.t.
(o:Tb_alias)->(dbskip(-1))
exit
endif
newpos++
ENDDO
ELSEIF NtoSkip < 0
// Skip backward
DO WHILE newpos > NtoSkip
(o:Tb_alias)->(dbskip(-1))
if ! (o:Tb_alias)->(Eval(o:Tb_FltrCond))
o:Hittop:=.t.
(o:Tb_alias)->(dbskip(1))
o:Tb_Pointer:=(o:Tb_alias)->(recno())
exit
endif
if (o:Tb_alias)->(bof())
STUFFKEY("")
tone(281,0)
exit
endif
newpos--
ENDDO
ENDIF
(o:Tb_ALIAS)->(DBSKIP(0))
o:Tb_Pointer:=(o:Tb_alias)->(Recno())
RETURN(newpos)
// *************************
function FltTop(o)
// *************************
// (o:Tb_ALIAS)->(dbGoTop())
if ! (o:Tb_ALIAS)->(Dbs (o:Tb_FltrTop))
(o:Tb_alias)->(dbgobottom())
(o:Tb_alias)->(dbskip())
endif
o:tb_pointer:=(o:tb_alias)->(Recno())
Return(o:tb_pointer)
// ******************************
function FltBottom(o)
// ******************************
local nlen,cs
nlen:=len(o:tb_FltrBottom)
cS :=Substr(o:tb_FltrBottom,1,nlen-1)
cS +=chr(asc(Substr(o:Tb_FltrBottom,nl
en,1))+1)
(o:Tb_ALIAS)->(DbS (cS ,.T.))
(o:Tb_ALIAS)->(DbSkip(-1))
o:tb_pointer:=(o:tb_alias)->(Recno())
Return(o:tb_pointer)
"Marcello" <md9@ibest.com.br> wrote in message
news:1137791378.115570.173490@o13g2000cwo.googlegroups.com...
Hi,
First of all When i was a clipper program I never used set
relation and set filter .
Iīm trying to make a very old program made by a fake programmer to use
ads.
This will only be used while the next program(written in JAVA) is being
made.
Many things became fast as it was espected but erything
that is realted to the comand set relation became really really slow
and the network traffic increased a lot.
The guy made a set relation and then Applied a filter on it,
I guess ADS is sending the whole table to the client and the clipper
program is then discarding the records by using set filter.
But why it had become so much slower than a pure clipper program?
Can AOF be the solution whitout i have to make changes
in the program "logic"?
Regards,
Marcello Dias
| |
| AUGE_OHR 2006-01-20, 6:55 pm |
| hi,
>The guy made a set relation and then Applied a filter on it,
can you show a example what he did ?
it does not make much sence to use a "filter" on related client database
while "set relation" itself works like a "filter" on related database
canīt you "put" his "filter" also into your "set relation" ?
>I guess ADS is sending the whole table to the client and the clipper
>program is then discarding the records by using set filter.
do you use ADS in "local" or "server" mode ?
in "server" mode all is done by "server" (RAM)
>But why it had become so much slower than a pure clipper program?
"local" mode or "server" ?
show us your ADS.INI
>Can AOF be the solution whitout i have to make changes in the
>program "logic"?
if you realy want to use "filter" expression AOF for "server" will work,
but you have to "optimize" AOF Expression (else 1st time need very
long to fill Cache)
.... but if you "optimize" (need Index) AOF Expression you also can use
SCOPE and that is realy fast !
greetings by OHR
Jimmy
| |
| Marcello 2006-01-22, 7:55 am |
| it does not make much sence to use a "filter" on related client
database
while "set relation" itself works like a "filter" on related database
The problem is that it retrieves all record in the base table of the
"join" and only then
applies the filter ,there is not a for clause like a select stament in
SQL.
"local" mode or "server" ?
show us your ADS.INI
this is the ini of thw winnt directory of the server machine.
[databases]
acmos=U:\sisacm\acmos.add;D
[acmos_info]
Username=adssys
ServerType=remote
LockingMode=proprietary
CharType=ansi
SecurityMode=ignorerights
DBFTableType=cdx
BlankPassword=no
BackupDestination=
RestoreDestination=
ExpandedNodes=USERS;
this is the ini use by adsdosip in the clients
[servidor]
COM_TYPE=AIS
INTERNET_IP=xxx.xxx.xxx.xxx
INTERNET_PORT=xxxx
IP=192.169.87.2
PORT=2003
Thank you for the help,
Marcello
| |
| Marcello 2006-01-22, 7:55 am |
| Hi,
another question.
How do I use the ax_setservertype function.
Is not documented at all.
Marcello
|
|
|
|
|