Page 1 of 4

Grid_1 command - performance?

Posted: Sun Apr 11, 2021 6:50 pm
by GeoffBarnard
Hello,

I've been playing with HMG for a couple of years, byt have just tried something a little more exciting.

I've used the GRID_35 demo prog, with some slight changes, to try to test a CDX data file/index from a commercial application regarding compatibility.

The dbf is about 100 Mb, with nearly a million records, and the file is working perfectly in the current application (my own code using 'C' with the Codebase library).

The GRID_35 demo prog has been changed to use my file/index, and it works fine for the initial display. But when I press END to drop to the bottom of the file, initially nothing happens, then the last screen-full of records appears one-by one, with a second or two pause between each one. On my system, the end screen would appear/fill almost instantly, as would any intervening screen.

The data appears to be correct, so I don't think there's a problem with the index (which was generated by by system). The GRID has calculated the top record for the screen and is displaying down from that to the EOF.

The process seems to be 'working', just sooo slowly. Am I missing anything regarding HMG, or the use of the GRID command.

Geoff - Guisborough, England

Re: Grid_1 command - performance?

Posted: Sun Apr 11, 2021 9:03 pm
by AUGE_OHR
hi,

please try GRID without Index
does it make a difference when press END ( GO BOTTOM ) :?:

Re: Grid_1 command - performance?

Posted: Sun Apr 11, 2021 9:29 pm
by GeoffBarnard
Hello,

OK, tried again with the lines re DBFCDX and SET KEY disabled.
Response to END is now immediate, as I would expect.
Should I generate index within HMG?
This would mean that the HMG CDX is not quite compatible with the CodeBase CDX, which is NOT a good thing

Thanks

Geoff

Re: Grid_1 command - performance?

Posted: Sun Apr 11, 2021 10:49 pm
by GeoffBarnard
I made another change to the prog, to generate the index anew.

The newly created index file is the same size as the original index file, however the end screen displays slowly, maybe a little faster than before.

Some further background. This using HMG 3.44 (should that be 3.0.44 ?). The data file is an Audit Trail file for a stock/warehouse system, where the data is added transaction by transaction, where each transaction may be anything from 1 to 100+ lines (products). The index then lists the items in Stock code and date order via the index, as opposed to the natural order. The file I'm using contains transactions up to 8th March 2021, and there are 1,011,112 records in the file.

Geoff

Re: Grid_1 command - performance?

Posted: Sun Apr 11, 2021 11:12 pm
by GeoffBarnard
The GRID seems to be OK at the top of the file, and does page Up/Down ok. If I try to do the same thing at the bottom of the file, the data seems to show correctly, but slowly, and after a few page Up/Downs the GRID locks up and ceases to respond.

This is a live system, in use daily. The CDX system has been very robust for me for a number of years now.

Geoff

Re: Grid_1 command - performance?

Posted: Sun Apr 11, 2021 11:31 pm
by salamandra
Hi @GeoffBarnard,
GeoffBarnard wrote: Sun Apr 11, 2021 11:12 pm The GRID seems to be OK at the top of the file, and does page Up/Down ok. If I try to do the same thing at the bottom of the file, the data seems to show correctly, but slowly, and after a few page Up/Downs the GRID locks up and ceases to respond.

This is a live system, in use daily. The CDX system has been very robust for me for a number of years now.
Did you try using a browse control instead a grid control ?
I had the same problem with grid and have replaced it by browse. Now all works fine for me.

best regards,


Salamandra, Brazil

Re: Grid_1 command - performance?

Posted: Sun Apr 11, 2021 11:50 pm
by Claudio Ricardo
Hi...
+1
I use Grid when data is from Mysql or Mariadb but with DBF i use Browse... the best way for me.

Re: Grid_1 command - performance?

Posted: Mon Apr 12, 2021 12:20 am
by AUGE_OHR
hi,

it is IHMO not the Problem of Control.
as Geoff say without Index it is fast

it have to do with sign in DBF and/or Index ... are there Sign > CHR(128)
btw. how long is your Index-Key ? 120 ? 240 ?

---

@Geoff : have a look at DBF "header"

Code: Select all

   FSEEK( nHandle, 0, 0 )      // Move pointer to first byte
   FREAD( nHandle, @cBuffer, 1 )
   FCLOSE( nHandle )
   nType := ASC( cBuffer )
OEM or ANSI ?

CDX can be Fox v2.x, SixDrive, Comix and visual FoxPro with different locking scheme
have a look into c:\hmg.3.4.4\HARBOUR\include\dbinfo.ch and search for DB_DBFLOCK_* Constant

try

Code: Select all

   RDDSETDEFAULT( "DBFCDX" )
   SET DBFLOCKSCHEME TO DB_DBFLOCK_CLIPPER

Re: Grid_1 command - performance?

Posted: Mon Apr 12, 2021 7:50 am
by mol
In my opinion grid is unusable for .dbf files.
Browse works very good

Re: Grid_1 command - performance?

Posted: Mon Apr 12, 2021 8:04 am
by serge_girard
I use grid with DBF but with paging and filtering. Otherwise too much overhead.

S