Grid_1 command - performance?

General Help regarding HMG, Compilation, Linking, Samples

Moderator: Rathinagiri

GeoffBarnard
Posts: 11
Joined: Fri Nov 08, 2013 11:28 pm
Location: Guisborough, England
Contact:

Grid_1 command - performance?

Post 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

User avatar
AUGE_OHR
Posts: 1448
Joined: Sun Aug 25, 2019 3:12 pm
DBs Used: DBF, PostgreSQL, MySQL, SQLite
Location: Hamburg, Germany
Has thanked: 267 times
Been thanked: 416 times

Post by AUGE_OHR »

hi,

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

GeoffBarnard
Posts: 11
Joined: Fri Nov 08, 2013 11:28 pm
Location: Guisborough, England
Contact:

Post 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

GeoffBarnard
Posts: 11
Joined: Fri Nov 08, 2013 11:28 pm
Location: Guisborough, England
Contact:

Post 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

GeoffBarnard
Posts: 11
Joined: Fri Nov 08, 2013 11:28 pm
Location: Guisborough, England
Contact:

Post 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

User avatar
salamandra
Posts: 308
Joined: Thu Jul 31, 2008 8:33 pm
DBs Used: DBF, MySQL, SQL
Location: Brazil
Has thanked: 209 times
Been thanked: 20 times

Post 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
There is one time in which is crucial awakening. That time is now. ( Buddha )

User avatar
Claudio Ricardo
Posts: 221
Joined: Tue Oct 27, 2020 3:38 am
DBs Used: DBF, MySQL, MariaDB
Location: Bs. As. - Argentina
Has thanked: 73 times
Been thanked: 91 times

Post 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.
Corrige al sabio y lo harás más sabio, Corrige al necio y lo harás tu enemigo.
WhatsApp / Telegram: +54 911-63016162

User avatar
AUGE_OHR
Posts: 1448
Joined: Sun Aug 25, 2019 3:12 pm
DBs Used: DBF, PostgreSQL, MySQL, SQLite
Location: Hamburg, Germany
Has thanked: 267 times
Been thanked: 416 times

Post 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
have fun
Jimmy

User avatar
mol
Posts: 3534
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Has thanked: 293 times
Been thanked: 213 times
Contact:

Post by mol »

In my opinion grid is unusable for .dbf files.
Browse works very good

User avatar
serge_girard
Posts: 2771
Joined: Sun Nov 25, 2012 2:44 pm
DBs Used: 1 MySQL - MariaDB
2 DBF
Location: Belgium
Has thanked: 1070 times
Been thanked: 193 times
Contact:

Post by serge_girard »

I use grid with DBF but with paging and filtering. Otherwise too much overhead.

S
Serge Now Is The Happiest Time Of Your Life !

Post Reply