FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Slow RDD experiences
Posts: 1303
Joined: Tue Jul 21, 2009 08:12 AM
Re: Slow RDD experiences
Posted: Thu May 29, 2014 04:31 PM

Antonio,

So if you set to .f. in your function, the program can´t work in network mode?.

I guess that´s what you don´t want, you need to work in a network.

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: 663
Joined: Mon Dec 05, 2005 11:22 PM
Re: Slow RDD experiences
Posted: Thu May 29, 2014 04:55 PM
cmxshared(.f.) or dbInfo( DBI_SHARED, .F. ) is used after you open the .dbf so it can be used on the network.
For instance
Code (fw): Select all Collapse
use mydbf share via "DBFCDX"
dbInfo( DBI_SHARED, .F. )
set order to 1
skip while .not. eof()


So the .dbf is opened in shared mode but the index locking for skip, seek, etc will be turned off so those actions work much faster.

The danger arises when there are people updating the index while you perform a skip or seek and the record you end up on may not be valid.
You should use this feature with care. I use it mostly on history data or data that is not changed all the time.
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Slow RDD experiences
Posted: Thu May 29, 2014 09:26 PM
Lucas,

Here you have this function docs (it should provide the same functionality):

http://www.ousob.com/ng/cmx/ngfe93.php
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 1091
Joined: Thu Nov 17, 2005 11:08 AM
Re: Slow RDD experiences
Posted: Fri May 30, 2014 12:37 PM
  1. What RDD were you using ?
    DBFCDX
  2. An upgrade of Harbour (or xHarbour) solved it ?
    NO
  3. Was it related to a certain Windows version ?
    NO
    4 Was it related to the network ?
    NO
  4. How did you fixed it ? :-)
    No fix
    Bye
Marco Boschi
info@marcoboschi.it
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: Slow RDD experiences
Posted: Fri May 30, 2014 12:41 PM
Marco,

MarcoBoschi wrote:4 Was it related to the network ?
NO


Are you saying that you experienced the slowness even with a local (no network) application???

EMG
Posts: 1091
Joined: Thu Nov 17, 2005 11:08 AM
Re: Slow RDD experiences
Posted: Fri May 30, 2014 02:16 PM

Beg your pardon,
I intend that in different scenarios the problem of slowness is the same
Microsoft, Linu, Novell, etc. etc.

Marco Boschi
info@marcoboschi.it
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Slow RDD experiences
Posted: Fri May 30, 2014 02:25 PM

Marco,

have you ever tried dbInfo( DBI_SHARED, .F. ) ? Just in the cases where you are reading data.

Docs are above.

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 90
Joined: Wed Nov 07, 2007 08:56 AM
Re: Slow RDD experiences
Posted: Tue Jun 03, 2014 08:41 AM
James Bott wrote:Patrizio,

The slow performance are due to deleted records but we can't use the INDEX ... FOR !Deleted()


Why can't you?

James


The dbf are used by both applications Fivewin and ,Net and the .Net provider doesn't handle well the FOR !Deleted() clause.
Posts: 1091
Joined: Thu Nov 17, 2005 11:08 AM
Re: Slow RDD experiences
Posted: Tue Jun 03, 2014 01:48 PM
Antonio,
this test is OK?
Code (fw): Select all Collapse
#include "dbinfo.ch"
ANNOUNCE RDDSYS


FUNCTION MAIN
LOCAL nInizio := SECONDS()
SET EXCLUSIVE OFF

USE aala
SET INDEX TO AALA
dbInfo( DBI_SHARED, .F. )
SET ORDER TO 1

DO WHILE !EOF()
//     ? field->bol_lav , field->rag_cli
   SKIP
ENDDO
? SECONDS() - nInizio

INIT PROCEDURE RddInit
REQUEST DBFFPT
REQUEST DBFCDX
rddSetDefault( "DBFCDX" )
RETURN
Marco Boschi
info@marcoboschi.it
Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
Re: Slow RDD experiences
Posted: Tue Jun 03, 2014 02:19 PM
Patrizio,

The dbf are used by both applications Fivewin and ,Net and the .Net provider doesn't handle well the FOR !Deleted() clause.


I would suggest reusing deleted records. Whenever you want to add a new record, first look for a deleted record and if found, use it, otherwise add a new record.

James
FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 90
Joined: Wed Nov 07, 2007 08:56 AM
Re: Slow RDD experiences
Posted: Tue Jun 03, 2014 02:46 PM
James Bott wrote:Patrizio,

The dbf are used by both applications Fivewin and ,Net and the .Net provider doesn't handle well the FOR !Deleted() clause.


I would suggest reusing deleted records. Whenever you want to add a new record, first look for a deleted record and if found, use it, otherwise add a new record.

James


It would be nice, but it would be extremely slow to find the first deleted record in a table with more than one million records unless you use a index with FOR Deleted() clause :-)
Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
Re: Slow RDD experiences
Posted: Tue Jun 03, 2014 05:20 PM
It would be nice, but it would be extremely slow to find the first deleted record in a table with more than one million records unless you use a index with FOR Deleted() clause


Hmm, are you saying you are unable to use any FOR clauses?

Maybe you could create another database containing the record numbers of the deleted records in the main database. When records are reused then you can delete those records. Since this database would be small, you could just search for a record that was not deleted (which would contain the recno of a record that WAS deleted in the main database). Hmm, I hope that wasn't too confusing.

James
FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Slow RDD experiences
Posted: Tue Jun 03, 2014 06:06 PM
Marco,

I have never tested it myself, but here you have the docs that explain it:

http://www.ousob.com/ng/cmx/ngfe93.php
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 90
Joined: Wed Nov 07, 2007 08:56 AM
Re: Slow RDD experiences
Posted: Wed Jun 04, 2014 07:28 AM
James Bott wrote:
It would be nice, but it would be extremely slow to find the first deleted record in a table with more than one million records unless you use a index with FOR Deleted() clause


Hmm, are you saying you are unable to use any FOR clauses?

Maybe you could create another database containing the record numbers of the deleted records in the main database. When records are reused then you can delete those records. Since this database would be small, you could just search for a record that was not deleted (which would contain the recno of a record that WAS deleted in the main database). Hmm, I hope that wasn't too confusing.

James


Surely it could work, I think it is more practical to schedule a weekly database's pack similarly to how we do on SQL Server.
Posts: 1467
Joined: Mon Oct 10, 2005 11:26 AM
Re: Slow RDD experiences
Posted: Wed Jun 04, 2014 07:59 AM

I tried to use "dbInfo( DBI_SHARED,.F.)" but I got an error : DBI_SHARED : variable does not exist.

Quid?

Regards,

Michel D.
Genk (Belgium)


_____________________________________________________________________________________________

I use : FiveWin for (x)Harbour v. 25.12 - Harbour 3.2.0 (May 2025) - xHarbour Builder (January 2020) - Bcc773