FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour slow xBrowse and ADS/AIS via Internet
Posts: 1303
Joined: Tue Jul 21, 2009 08:12 AM
slow xBrowse and ADS/AIS via Internet
Posted: Mon Mar 12, 2012 07: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 (fw): Select all Collapse
 聽 

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.
Posts: 811
Joined: Tue May 06, 2008 04:28 AM
Re: slow xBrowse and ADS/AIS via Internet
Posted: 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
Posts: 1303
Joined: Tue Jul 21, 2009 08:12 AM
Re: slow xBrowse and ADS/AIS via Internet
Posted: 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.
Posts: 1303
Joined: Tue Jul 21, 2009 08:12 AM
Re: slow xBrowse and ADS/AIS via Internet
Posted: Tue Mar 13, 2012 09: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.
Posts: 6983
Joined: Fri Oct 07, 2005 07:07 PM
Re: slow xBrowse and ADS/AIS via Internet
Posted: Tue Mar 13, 2012 09: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

Posts: 811
Joined: Tue May 06, 2008 04:28 AM
Re: slow xBrowse and ADS/AIS via Internet
Posted: 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
Posts: 1303
Joined: Tue Jul 21, 2009 08:12 AM
Re: slow xBrowse and ADS/AIS via Internet
Posted: Wed Mar 14, 2012 08: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.
Posts: 811
Joined: Tue May 06, 2008 04:28 AM
Re: slow xBrowse and ADS/AIS via Internet
Posted: Wed Mar 14, 2012 09: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
Posts: 1303
Joined: Tue Jul 21, 2009 08:12 AM
Re: slow xBrowse and ADS/AIS via Internet
Posted: Wed Mar 14, 2012 09: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.
Posts: 811
Joined: Tue May 06, 2008 04:28 AM
Re: slow xBrowse and ADS/AIS via Internet
Posted: Thu Mar 15, 2012 01: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
Posts: 1303
Joined: Tue Jul 21, 2009 08:12 AM
Re: slow xBrowse and ADS/AIS via Internet
Posted: Thu Mar 15, 2012 08: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.
Posts: 811
Joined: Tue May 06, 2008 04:28 AM
Re: slow xBrowse and ADS/AIS via Internet
Posted: Thu Mar 15, 2012 09: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
Posts: 1303
Joined: Tue Jul 21, 2009 08:12 AM
Re: slow xBrowse and ADS/AIS via Internet
Posted: 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.

Continue the discussion