Another Grid Problem

General Help regarding HMG, Compilation, Linking, Samples

Moderator: Rathinagiri

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

Re: Another Grid Problem

Post by franco »

I have found over the years it is not good to use filters on large tables.
I have been trying to figure out sql but I think i am giving up on it, as I have learned to use temporary tables.
I am know using 5 temporary tables to do what a simple sql command would do, but it works excellent, but much slower.
The nice thing is when you index a temp table the index is in memory also, so it is very quick.
I have tried the end and home buttons on my tables in a grid and have no problems.
I have 5 index buttons on my screen to change the sort. it is almost instant and still can go top and bottom of the indexed file.
With a filtered table you could be skipping 50,000 records with a down arrow, which is very slow.
Try to use something like index on XXXX to temp for XXXX = 'YYYY'. only Y record are in your index and it is very fast.
This is the same as set filter to XXXX := "YYYY". go top.
Hope this is what your looking for.
Regards Franco
All The Best,
Franco
Canada
User avatar
mol
Posts: 3723
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Contact:

Re: Another Grid Problem

Post by mol »

I was using temporary conditional indexes in my app, but it raises another problem - when you modify your data or add new records, basic indexes become invalid - you need to rebuild them after clearing filter.
Filters, in my opinion, are useful, but shouldn't be used for normal data presentation.
It's better to project your app to use indexes and ordscope and leave filtering for user decision as built-in option.
User avatar
mol
Posts: 3723
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Contact:

Re: Another Grid Problem

Post by mol »

Returning to GRID and its bad work - it shouldn't happen such a situation, when you press ctrl-end and you don't reach end of table.
edk
Posts: 914
Joined: Thu Oct 16, 2014 11:35 am
Location: Poland

Re: Another Grid Problem

Post by edk »

@franco: Yes, you are right that the use of a filter for large databases is not very effective.
Therefore, in the console version of the program, databases are properly indexed. I'm using the class 'TBrowse' together with the variable of instance SkipBlock, to 'filter' the data. This solves the problem of slow browsing datas.
However, I can't use skipBlock for 'Grid' or 'Browse', so I returned to the filtering functionality.
I can't also change the structure of the databases and functionality of datas, because of the existing DBF and indexing files are used by other applications, which I don't have sources.

@Marek. Thx Marek, I think that ORDSCOPE() solve my problem with 'filtering'

Btw, it seems to me that this is a 'Grid' bug.
Post Reply