Slow RDD experiences

User avatar
lucasdebeltran
Posts: 1303
Joined: Tue Jul 21, 2009 8:12 am
Contact:

Re: Slow RDD experiences

Post by lucasdebeltran »

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.
Gale FORd
Posts: 663
Joined: Mon Dec 05, 2005 11:22 pm
Location: Houston
Contact:

Re: Slow RDD experiences

Post by Gale FORd »

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: Select all

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.
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: Slow RDD experiences

Post by Antonio Linares »

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
User avatar
MarcoBoschi
Posts: 925
Joined: Thu Nov 17, 2005 11:08 am
Location: Padova - Italy
Contact:

Re: Slow RDD experiences

Post by MarcoBoschi »

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
5. How did you fixed it ? :-)
No fix
Bye
Marco Boschi
info@marcoboschi.it
User avatar
Enrico Maria Giordano
Posts: 7355
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia
Contact:

Re: Slow RDD experiences

Post by Enrico Maria Giordano »

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
User avatar
MarcoBoschi
Posts: 925
Joined: Thu Nov 17, 2005 11:08 am
Location: Padova - Italy
Contact:

Re: Slow RDD experiences

Post by MarcoBoschi »

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
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: Slow RDD experiences

Post by Antonio Linares »

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
Patrizio
Posts: 90
Joined: Wed Nov 07, 2007 8:56 am
Location: Italy
Contact:

Re: Slow RDD experiences

Post by Patrizio »

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.
User avatar
MarcoBoschi
Posts: 925
Joined: Thu Nov 17, 2005 11:08 am
Location: Padova - Italy
Contact:

Re: Slow RDD experiences

Post by MarcoBoschi »

Antonio,
this test is OK?

Code: Select all

#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
User avatar
James Bott
Posts: 4654
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA
Contact:

Re: Slow RDD experiences

Post by James Bott »

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
Patrizio
Posts: 90
Joined: Wed Nov 07, 2007 8:56 am
Location: Italy
Contact:

Re: Slow RDD experiences

Post by Patrizio »

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 :lol:
User avatar
James Bott
Posts: 4654
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA
Contact:

Re: Slow RDD experiences

Post by James Bott »

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
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: Slow RDD experiences

Post by Antonio Linares »

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
Patrizio
Posts: 90
Joined: Wed Nov 07, 2007 8:56 am
Location: Italy
Contact:

Re: Slow RDD experiences

Post by Patrizio »

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.
User avatar
driessen
Posts: 1239
Joined: Mon Oct 10, 2005 11:26 am
Location: Genk, Belgium

Re: Slow RDD experiences

Post by driessen »

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. 21.01 - Harbour 3.2.0 (October 2020) - xHarbour Builder (January 2020) - Bcc7
Post Reply