Page 2 of 4

Re: Slow RDD experiences

Posted: Thu May 29, 2014 4:31 pm
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.

Re: Slow RDD experiences

Posted: Thu May 29, 2014 4:55 pm
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.

Re: Slow RDD experiences

Posted: Thu May 29, 2014 9:26 pm
by Antonio Linares
Lucas,

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

http://www.ousob.com/ng/cmx/ngfe93.php

Re: Slow RDD experiences

Posted: Fri May 30, 2014 12:37 pm
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

Re: Slow RDD experiences

Posted: Fri May 30, 2014 12:41 pm
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

Re: Slow RDD experiences

Posted: Fri May 30, 2014 2:16 pm
by MarcoBoschi
Beg your pardon,
I intend that in different scenarios the problem of slowness is the same
Microsoft, Linu, Novell, etc. etc.

Re: Slow RDD experiences

Posted: Fri May 30, 2014 2:25 pm
by Antonio Linares
Marco,

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

Docs are above.

Re: Slow RDD experiences

Posted: Tue Jun 03, 2014 8:41 am
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.

Re: Slow RDD experiences

Posted: Tue Jun 03, 2014 1:48 pm
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
 

Re: Slow RDD experiences

Posted: Tue Jun 03, 2014 2:19 pm
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

Re: Slow RDD experiences

Posted: Tue Jun 03, 2014 2:46 pm
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:

Re: Slow RDD experiences

Posted: Tue Jun 03, 2014 5:20 pm
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

Re: Slow RDD experiences

Posted: Tue Jun 03, 2014 6:06 pm
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

Re: Slow RDD experiences

Posted: Wed Jun 04, 2014 7:28 am
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.

Re: Slow RDD experiences

Posted: Wed Jun 04, 2014 7:59 am
by driessen
I tried to use "dbInfo( DBI_SHARED,.F.)" but I got an error : DBI_SHARED : variable does not exist.

Quid?