slow xBrowse and ADS/AIS via Internet

slow xBrowse and ADS/AIS via Internet

Postby lucasdebeltran » Mon Mar 12, 2012 7:50 am

Hello,

I am testing accesing DBF via Internet with ADS and AIS.

It goes pretty well but xBrowses are slow.

I searched into forums and there are some posts suggest to change AdsGetRecordCount(), AdsSetDeleted(.t.), etc... but I don´t understand them well as it´s my first time with ADS.

But the replies to this post willl be very interesting for the community.

This is my code:

Code: Select all  Expand view
 

FUNCTION MAIN()

[...]

// Sets generales---------------------------------------------------------
   SetGetColorFocus()              
   SET EPOCH TO 1990              
   SET CENTURY ON                  
   SET DATE ITALIAN                
   SET DELETED ON                  
   SetCancel( .F. )                
   SetDialogEsc( .F. )            
   SET( _SET_INSERT, .T. )        




    Request ADS,ADSKeyCount,ADSKeyNo,OrdKeyCount,OrdKeyNo, AdsGetRelKeyPos, AdsSetRelKeyPos

     RddRegister( "ADS", 1 )
     RddSetDefault( "ADS" )

     //setting up server type
     // 1 = Local Server (no client / server)
     // 2 = Remote Server
     // 3 = Local + Remot
     // 4 = Internet Server
     // 5 = Local + Internet
     // 6 = Remote+Internet
     // 7 = Local + Remote + Internet , best choice
     adsSetServerType( 4 )  // ó  adsSetServerType( ADS_REMOTE_SERVER )

     //setting up the file types
     // 1 = DBFNTX
     // 2 = DBFCDX
     // 3 = ADSADI
     adsSetFileType( ADS_CDX )  // o ADS_CDX
   // -------------------------------------------------------------------------




   // Opening DBF FILES
   [...]
   SELECT 5
   USE (cMyPath+"FACTURAS") INDEX (cMyPath+"FACTURAS")  SHARED NEW  ALIAS "FACTURAS"



  // INDEXING
  [...]
 
  USE (cMyPath+"FACTURAS")   EXCLUSIVE NEW
  DELETE ALL FOR EMPTY( FIELD->NUMERO )
  PACK

  INDEX ON FIELD->NUMERO  TO (cMyPath+"FACTURAS")
  DbCloseAll()
 



Please, what should apply to achieve best results?.

Thank you very much.

Best regards,
Muchas gracias. Many thanks.

Un saludo, Best regards,

Harbour 3.2.0dev, Borland C++ 5.82 y FWH 13.06 [producción]

Implementando MSVC 2010, FWH64 y ADO.

Abandonando uso xHarbour y SQLRDD.
User avatar
lucasdebeltran
 
Posts: 1303
Joined: Tue Jul 21, 2009 8:12 am

Re: slow xBrowse and ADS/AIS via Internet

Postby fraxzi » Tue Mar 13, 2012 12:16 am

Hi Lucas,

1. Issue cAlias->( AdsCacheRecords( <nRecs> ) ) or TABLE->( AdsCacheRecords( 50 ) ).. in my case, it improves the speed.
2. on your ads.ini:
[Settings]
COMPRESSION = Always
USE_TCP_IP = 1
PACKET_SIZE = 512 ;or 1024

This also improves my speed.


Kind regards,
Kind Regards,
Frances

Fivewin for xHarbour v18.07
xHarbour v1.2.3.x
BCC 7.3 + PellesC8 ( Resource Compiler only)
ADS 10.1 / MariaDB
Crystal Reports 8.5/9.23 DE
xMate v1.15
User avatar
fraxzi
 
Posts: 811
Joined: Tue May 06, 2008 4:28 am
Location: Philippines

Re: slow xBrowse and ADS/AIS via Internet

Postby lucasdebeltran » Tue Mar 13, 2012 10:56 am

Francis,

Thanks for helping me.

This ads.ini, where should be placed?. At server directory or application directory?.

Also I read not to use SET DELETED ON.

I set to OFF and I improve a little bit the speed.

But do you create indexes as INDEX ON FIELD->NUMERO TO (cMyPath+"PEDIDOS2") FOR !Deleted() ?.

Thank you very much.
Muchas gracias. Many thanks.

Un saludo, Best regards,

Harbour 3.2.0dev, Borland C++ 5.82 y FWH 13.06 [producción]

Implementando MSVC 2010, FWH64 y ADO.

Abandonando uso xHarbour y SQLRDD.
User avatar
lucasdebeltran
 
Posts: 1303
Joined: Tue Jul 21, 2009 8:12 am

Re: slow xBrowse and ADS/AIS via Internet

Postby lucasdebeltran » Tue Mar 13, 2012 9:09 pm

Mr. Nages,

Please, any advice?.

Thank you very much.
Muchas gracias. Many thanks.

Un saludo, Best regards,

Harbour 3.2.0dev, Borland C++ 5.82 y FWH 13.06 [producción]

Implementando MSVC 2010, FWH64 y ADO.

Abandonando uso xHarbour y SQLRDD.
User avatar
lucasdebeltran
 
Posts: 1303
Joined: Tue Jul 21, 2009 8:12 am

Re: slow xBrowse and ADS/AIS via Internet

Postby Otto » Tue Mar 13, 2012 9:26 pm

Hello Lucas,
do you browse the database or do you read the database into an array and browse the array.
Best regards,
Otto
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6066
Joined: Fri Oct 07, 2005 7:07 pm

Re: slow xBrowse and ADS/AIS via Internet

Postby fraxzi » Wed Mar 14, 2012 12:14 am

lucasdebeltran wrote:Francis,

Thanks for helping me.

This ads.ini, where should be placed?. At server directory or application directory?.

Also I read not to use SET DELETED ON.

I set to OFF and I improve a little bit the speed.

But do you create indexes as INDEX ON FIELD->NUMERO TO (cMyPath+"PEDIDOS2") FOR !Deleted() ?.

Thank you very much.


Put ads.ini with your .exe, in any case on your client pc.
With ADS SQL I rarely use index.. but yes I do create but with SQL's INDEX command for better server-side process.. means better speed.
Kind Regards,
Frances

Fivewin for xHarbour v18.07
xHarbour v1.2.3.x
BCC 7.3 + PellesC8 ( Resource Compiler only)
ADS 10.1 / MariaDB
Crystal Reports 8.5/9.23 DE
xMate v1.15
User avatar
fraxzi
 
Posts: 811
Joined: Tue May 06, 2008 4:28 am
Location: Philippines

Re: slow xBrowse and ADS/AIS via Internet

Postby lucasdebeltran » Wed Mar 14, 2012 8:53 am

Frances,

Thank you very much for helping me.

When you create indexes, yo you add !DELETED(), kike

INDEX ON FIELD->NUMERO TO (cMyPath+"PEDIDOS") FOR !Deleted() ?

Best regards,
Muchas gracias. Many thanks.

Un saludo, Best regards,

Harbour 3.2.0dev, Borland C++ 5.82 y FWH 13.06 [producción]

Implementando MSVC 2010, FWH64 y ADO.

Abandonando uso xHarbour y SQLRDD.
User avatar
lucasdebeltran
 
Posts: 1303
Joined: Tue Jul 21, 2009 8:12 am

Re: slow xBrowse and ADS/AIS via Internet

Postby fraxzi » Wed Mar 14, 2012 9:01 am

Hi Lucas,

Yes I do before when I use to code ISAM style.
Kind Regards,
Frances

Fivewin for xHarbour v18.07
xHarbour v1.2.3.x
BCC 7.3 + PellesC8 ( Resource Compiler only)
ADS 10.1 / MariaDB
Crystal Reports 8.5/9.23 DE
xMate v1.15
User avatar
fraxzi
 
Posts: 811
Joined: Tue May 06, 2008 4:28 am
Location: Philippines

Re: slow xBrowse and ADS/AIS via Internet

Postby lucasdebeltran » Wed Mar 14, 2012 9:48 am

Thank you.

Last question.

When using ADS in local mode, indexes are .idx.

But in Internet mode with AIS indexes are .cdx.

The code is the same.

Why this difference?.

Thank you.
Muchas gracias. Many thanks.

Un saludo, Best regards,

Harbour 3.2.0dev, Borland C++ 5.82 y FWH 13.06 [producción]

Implementando MSVC 2010, FWH64 y ADO.

Abandonando uso xHarbour y SQLRDD.
User avatar
lucasdebeltran
 
Posts: 1303
Joined: Tue Jul 21, 2009 8:12 am

Re: slow xBrowse and ADS/AIS via Internet

Postby fraxzi » Thu Mar 15, 2012 1:37 am

lucasdebeltran wrote:Thank you.

Last question.

When using ADS in local mode, indexes are .idx.

But in Internet mode with AIS indexes are .cdx.

The code is the same.

Why this difference?.

Thank you.


Dear Lucas,

You need to set AdsSetFileType( ADS_CDX ) if you want .cdx or an expression on your index indicating the orderbag..
these vars are to consider from ads.ch
/* Supported file types */
#define ADS_NTX 1
#define ADS_CDX 2
#define ADS_ADT 3
#define ADS_VFP 4
Kind Regards,
Frances

Fivewin for xHarbour v18.07
xHarbour v1.2.3.x
BCC 7.3 + PellesC8 ( Resource Compiler only)
ADS 10.1 / MariaDB
Crystal Reports 8.5/9.23 DE
xMate v1.15
User avatar
fraxzi
 
Posts: 811
Joined: Tue May 06, 2008 4:28 am
Location: Philippines

Re: slow xBrowse and ADS/AIS via Internet

Postby lucasdebeltran » Thu Mar 15, 2012 8:18 am

Dear Frances,

Thank you very much for helping me.

I have set up adsSetFileType( ADS_CDX )

But if I use and open the file in local mode, index are .idx. In remote server with Data Dictionary via Internet, they are .cdx!!.

It is strange. Do you experiment this behaviour?.

Thanks again.
Muchas gracias. Many thanks.

Un saludo, Best regards,

Harbour 3.2.0dev, Borland C++ 5.82 y FWH 13.06 [producción]

Implementando MSVC 2010, FWH64 y ADO.

Abandonando uso xHarbour y SQLRDD.
User avatar
lucasdebeltran
 
Posts: 1303
Joined: Tue Jul 21, 2009 8:12 am

Re: slow xBrowse and ADS/AIS via Internet

Postby fraxzi » Thu Mar 15, 2012 9:06 am

lucasdebeltran wrote:Dear Frances,

Thank you very much for helping me.

I have set up adsSetFileType( ADS_CDX )

But if I use and open the file in local mode, index are .idx. In remote server with Data Dictionary via Internet, they are .cdx!!.

It is strange. Do you experiment this behaviour?.

Thanks again.



Dear Lucas,

No I did not experienced that. When I switched to ADS.. I use the proprietary table format.

I no longer use .DBF/.CDX.. I used .ADT/.ADI much efficient.
Kind Regards,
Frances

Fivewin for xHarbour v18.07
xHarbour v1.2.3.x
BCC 7.3 + PellesC8 ( Resource Compiler only)
ADS 10.1 / MariaDB
Crystal Reports 8.5/9.23 DE
xMate v1.15
User avatar
fraxzi
 
Posts: 811
Joined: Tue May 06, 2008 4:28 am
Location: Philippines

Re: slow xBrowse and ADS/AIS via Internet

Postby lucasdebeltran » Thu Mar 15, 2012 10:54 am

Dear Frances,

Thank you very much for your attention.

Best regards
Muchas gracias. Many thanks.

Un saludo, Best regards,

Harbour 3.2.0dev, Borland C++ 5.82 y FWH 13.06 [producción]

Implementando MSVC 2010, FWH64 y ADO.

Abandonando uso xHarbour y SQLRDD.
User avatar
lucasdebeltran
 
Posts: 1303
Joined: Tue Jul 21, 2009 8:12 am


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 39 guests