Grid_1 command - performance?

General Help regarding HMG, Compilation, Linking, Samples

Moderator: Rathinagiri

User avatar
andyglezl
Posts: 1461
Joined: Fri Oct 26, 2012 7:58 pm
Location: Guadalajara Jalisco, MX
Contact:

Re: Grid_1 command - performance?

Post by andyglezl »

GeoffBarnard wrote: Sun Apr 11, 2021 6:50 pm 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

Maybe this help...

viewtopic.php?f=24&t=4826&p=45910&hilit ... ese#p45910
Andrés González López
Desde Guadalajara, Jalisco. México.
GeoffBarnard
Posts: 11
Joined: Fri Nov 08, 2013 11:28 pm
Location: Guisborough, England
Contact:

Re: Grid_1 command - performance?

Post by GeoffBarnard »

BROWSE.02 works much better. Great.

More detailed reply lost by forum??

Thanks. Geoff
franco
Posts: 816
Joined: Sat Nov 02, 2013 5:42 am
DBs Used: DBF
Location: Canada

Re: Grid_1 command - performance?

Post by franco »

In my invoicing program I use grid for invoice. Handles 100 records per invoice ok.
For inventory lookup to add to invoice I use a browse 1,000,000 records.
All The Best,
Franco
Canada
User avatar
AUGE_OHR
Posts: 2060
Joined: Sun Aug 25, 2019 3:12 pm
DBs Used: DBF, PostgreSQL, MySQL, SQLite
Location: Hamburg, Germany

Re: Grid_1 command - performance?

Post by AUGE_OHR »

andyglezl wrote: Mon Apr 12, 2021 2:14 pm Maybe this help...
viewtopic.php?f=24&t=4826&p=45910&hilit ... ese#p45910
good point :!:

when have many DELETED() Record but "hide" it with SET DELETED ON than you can get that slow down Effect

as i do not "re-use" DELETED() i use

Code: Select all

   INDEX ON FIELD TO XYZ FOR !DELETED()
to avoid those Problem
have fun
Jimmy
GeoffBarnard
Posts: 11
Joined: Fri Nov 08, 2013 11:28 pm
Location: Guisborough, England
Contact:

Re: Grid_1 command - performance?

Post by GeoffBarnard »

Thanks for your comments.

As noted, the BROWSE control seems NOT to have this problem.

Regarding the suggestion above, I should note that the database has VERY few deleted records, and SET DELETED is not ON. I've checked the data in the full working application, and there are no deleted records in the last couple of pages at least.

Maybe I should create indexes using NDX and NTX and see if they behave the same?

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

Re: Grid_1 command - performance?

Post by GeoffBarnard »

Still interested to answer the 'why' here.

I've gone back to the GRID I tried first, based from the GRID_35 sample.

Regen this prog to use the same dbf, but now with a NTX file using the same key.

The CDX file was 6 or so Mb, the NTX is 24 or so Mb. That's by the way.

When I use END to drop to the bottom of the file, the screen is updated slowly line-by-line, but much faster than with the CDX. Maybe 3 or 4 times faster. A Page-UP is slow. but barely practical. Both better than the CDX option.

So it's not JUST about the CDX??

Geoff
franco
Posts: 816
Joined: Sat Nov 02, 2013 5:42 am
DBs Used: DBF
Location: Canada

Re: Grid_1 command - performance?

Post by franco »

Jimmy is only using deleted as example. As I sais above for my invoicing I use a grid.
My invoice items file has 1,500,000 records. My Invoice File gas 50,000 records
if invoice field inv_no equals 100175.

Code: Select all

use invoice 
index is inv_no
use pinv_it
index is inv   / I use different field name to stop confusion.
set relation to inv into INVOICE
select invoice 
seek '100175'
select inv_item
index on inv to invtemp for inv = invoice->inv_no
Now I use GRID to work with the data which may only be 5 items.
To scan any full tables I use browse. I never use browse to work with data. I never use grid to scan data.
All The Best,
Franco
Canada
User avatar
tonton2
Posts: 444
Joined: Sat Jun 29, 2013 1:26 pm
Location: Algerie
Contact:

Re: Grid_1 command - performance?

Post by tonton2 »

Bonsoir a tous les hmgistes,
comment transférer mes tables DBF en une base de donnée MySql
how to transfer my DBF tables into a MySql database
Merci d'avance
L'Algerie vous salut
Y.TABET
User avatar
serge_girard
Posts: 3161
Joined: Sun Nov 25, 2012 2:44 pm
DBs Used: 1 MySQL - MariaDB
2 DBF
Location: Belgium
Contact:

Re: Grid_1 command - performance?

Post by serge_girard »

Tonton,

More then 1 solution:
1) With a DBF-Viewer such as DBFVIEW2000 (save as .SQL)
2) Write your own DO WHILE .NOT EOF() .... INSERT INTO ... SKIP ENDDO

Serge
There's nothing you can do that can't be done...
User avatar
tonton2
Posts: 444
Joined: Sat Jun 29, 2013 1:26 pm
Location: Algerie
Contact:

Re: Grid_1 command - performance?

Post by tonton2 »

merci mon ami , je vais chercher sur internet
L'Algerie vous salut
Y.TABET
Post Reply