FW_OpenRecordSet lento en red

FW_OpenRecordSet lento en red

Postby jpcavagnaro » Sun Dec 17, 2023 11:50 pm

Hola gente, estoy teniendo problemas se pone muy lento en red es una constulta muy sencilla:

cSQL := "SELECT top 20 numero,nombre,domic FROM clientes"
oRs1 := FW_OpenRecordSet( oCn, cSQL )

de que manera puedo acelerar esto, porque se pone muy lento.
Jorge
Saludos.
jpcavagnaro
 
Posts: 155
Joined: Tue Oct 11, 2016 1:02 pm
Location: Luján, bs. as.

Re: FW_OpenRecordSet lento en red

Postby Rick Lipkin » Mon Dec 18, 2023 12:30 am

Jeorge

Try the old fashoned way where you set the Recordset properties manually ...

Code: Select all  Expand view

oRs1 := TOleAuto():New( "ADODB.Recordset" )
oRs1:CursorType     := 1        // opendkeyset
oRs1:CursorLocation := 3       // local cache
oRs1:LockType       := 3         // lockoportunistic

TRY
   oRs1:Open(cSQL,oCn )
CATCH oErr
   MsgInfo( "Error in Opening CLIENTS table" )
   RETURN(.F.)
END TRY


 


Rick Lipkin
User avatar
Rick Lipkin
 
Posts: 2665
Joined: Fri Oct 07, 2005 1:50 pm
Location: Columbia, South Carolina USA

Re: FW_OpenRecordSet lento en red

Postby nageswaragunupudi » Mon Dec 18, 2023 6:06 am

Rick Lipkin wrote:Jeorge

Try the old fashoned way where you set the Recordset properties manually ...

Code: Select all  Expand view

oRs1 := TOleAuto():New( "ADODB.Recordset" )
oRs1:CursorType     := 1        // opendkeyset
oRs1:CursorLocation := 3       // local cache
oRs1:LockType       := 3         // lockoportunistic

TRY
   oRs1:Open(cSQL,oCn )
CATCH oErr
   MsgInfo( "Error in Opening CLIENTS table" )
   RETURN(.F.)
END TRY


 


Rick Lipkin


This is what FW_OpenRecordSet( oCn, cSql ) function does.
What is the extra thing you are doing to speed up the query?

Another important information to all of u:
Whatever value we specify for oRs:CursorType, ADO invariably opens the recordset as adOpenStatic only for CursorLocation adUseClient.
There is not point in assigning a value like adOpenKeySet or adOpenDynamic
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10643
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: FW_OpenRecordSet lento en red

Postby nageswaragunupudi » Mon Dec 18, 2023 6:07 am

jpcavagnaro wrote:Hola gente, estoy teniendo problemas se pone muy lento en red es una constulta muy sencilla:

cSQL := "SELECT top 20 numero,nombre,domic FROM clientes"
oRs1 := FW_OpenRecordSet( oCn, cSQL )

de que manera puedo acelerar esto, porque se pone muy lento.


When we use TOP n, it is desirable to use ORDER BY clause.
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10643
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: FW_OpenRecordSet lento en red

Postby Armando » Mon Dec 18, 2023 4:04 pm

Friends:

In addition to the ORDER BY clause, try using the LIMIT 20 clause.

Best regards
SOI, s.a. de c.v.
estbucarm@gmail.com
http://www.soisa.mex.tl/
http://sqlcmd.blogspot.com/
Tel. (722) 174 44 45
Carpe diem quam minimum credula postero
User avatar
Armando
 
Posts: 3228
Joined: Fri Oct 07, 2005 8:20 pm
Location: Toluca, México

Re: FW_OpenRecordSet lento en red

Postby nageswaragunupudi » Mon Dec 18, 2023 4:40 pm

Armando wrote:Friends:

In addition to the ORDER BY clause, try using the LIMIT 20 clause.

Best regards


He is already using TOP 20 clause.
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10643
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: FW_OpenRecordSet lento en red

Postby Armando » Mon Dec 18, 2023 5:42 pm

Mr. Rao:

You are right, it is just to see if the LIMIT 20 clause gains speed.

Greetings
SOI, s.a. de c.v.
estbucarm@gmail.com
http://www.soisa.mex.tl/
http://sqlcmd.blogspot.com/
Tel. (722) 174 44 45
Carpe diem quam minimum credula postero
User avatar
Armando
 
Posts: 3228
Joined: Fri Oct 07, 2005 8:20 pm
Location: Toluca, México

Re: FW_OpenRecordSet lento en red

Postby nageswaragunupudi » Mon Dec 18, 2023 6:20 pm

MySql : LIMIT n
MsSql : TOP n
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10643
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: FW_OpenRecordSet lento en red

Postby jpcavagnaro » Mon Dec 18, 2023 6:36 pm

Gracias por responder, probe con order by y sigue lento.

En forma local funciona rápido, pero cuando trabajo desde un terminal se pone lento y si la pc no es muy nueva lentísima, recuerdo que es para facturar, o sea que debe tener respuesta rápida.
Jorge
Saludos.
jpcavagnaro
 
Posts: 155
Joined: Tue Oct 11, 2016 1:02 pm
Location: Luján, bs. as.


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 69 guests

cron