Slow RDD experiences

Re: Slow RDD experiences

Postby lucasdebeltran » Thu May 29, 2014 4: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.
User avatar
lucasdebeltran
 
Posts: 1303
Joined: Tue Jul 21, 2009 8:12 am

Re: Slow RDD experiences

Postby Gale FORd » Thu May 29, 2014 4: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: Select all  Expand view
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.
Gale FORd
 
Posts: 663
Joined: Mon Dec 05, 2005 11:22 pm
Location: Houston

Re: Slow RDD experiences

Postby Antonio Linares » Thu May 29, 2014 9: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
User avatar
Antonio Linares
Site Admin
 
Posts: 41314
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Slow RDD experiences

Postby MarcoBoschi » 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
5. How did you fixed it ? :-)
No fix
Bye
User avatar
MarcoBoschi
 
Posts: 1015
Joined: Thu Nov 17, 2005 11:08 am
Location: Padova - Italy

Re: Slow RDD experiences

Postby Enrico Maria Giordano » 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
User avatar
Enrico Maria Giordano
 
Posts: 8315
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: Slow RDD experiences

Postby MarcoBoschi » Fri May 30, 2014 2:16 pm

Beg your pardon,
I intend that in different scenarios the problem of slowness is the same
Microsoft, Linu, Novell, etc. etc.
User avatar
MarcoBoschi
 
Posts: 1015
Joined: Thu Nov 17, 2005 11:08 am
Location: Padova - Italy

Re: Slow RDD experiences

Postby Antonio Linares » Fri May 30, 2014 2: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
User avatar
Antonio Linares
Site Admin
 
Posts: 41314
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Slow RDD experiences

Postby Patrizio » Tue Jun 03, 2014 8: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.
Patrizio
 
Posts: 90
Joined: Wed Nov 07, 2007 8:56 am
Location: Italy

Re: Slow RDD experiences

Postby MarcoBoschi » Tue Jun 03, 2014 1:48 pm

Antonio,
this test is OK?
Code: Select all  Expand view

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

Re: Slow RDD experiences

Postby James Bott » Tue Jun 03, 2014 2: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
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Re: Slow RDD experiences

Postby Patrizio » Tue Jun 03, 2014 2: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 :lol:
Patrizio
 
Posts: 90
Joined: Wed Nov 07, 2007 8:56 am
Location: Italy

Re: Slow RDD experiences

Postby James Bott » Tue Jun 03, 2014 5: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
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Re: Slow RDD experiences

Postby Antonio Linares » Tue Jun 03, 2014 6: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
User avatar
Antonio Linares
Site Admin
 
Posts: 41314
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Slow RDD experiences

Postby Patrizio » Wed Jun 04, 2014 7: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.
Patrizio
 
Posts: 90
Joined: Wed Nov 07, 2007 8:56 am
Location: Italy

Re: Slow RDD experiences

Postby driessen » Wed Jun 04, 2014 7: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. 24.02 - Harbour 3.2.0 (February 2024) - xHarbour Builder (January 2020) - Bcc77
User avatar
driessen
 
Posts: 1396
Joined: Mon Oct 10, 2005 11:26 am
Location: Genk, Belgium

PreviousNext

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Silvio.Falconi and 85 guests