Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VFP 9 index bloat?

Status
Not open for further replies.

fourletr

Technical User
Dec 1, 2003
29
0
0
CA
I remember that in FP2.6 issuing just a REINDEX caused indexes to get larger and larger despite the fact that the table had not increased in size. We used to issue a DELETE TAG ALL and then rebuild all the indexes. Does this still apply to VFP 9 or can we just use REINDEX without deleting and rebuilding?

Richard Myers (aka - fourletr)
Burlington - Ontario
Canada
 
Tasg expression info is stored in the CDX, if you reindex from a healthy CDX that's ok, but if you reindex because of an index bug, then perhaps you reintroduce that.

Therefore best practice actually is to store index expression info in meta data, delete tag all and rebuild, as you're used to. Another way is to restore a working CDX (not necessarily in synch with data) and reindex.

It's true though, that from a healthy DBF/CDX you can REINDEX and the CDX will not bloat. Bloating effect is still there for FPT Memo files, but not for indexes.

Bye, Olaf.
 
While DELETE TAG ALL and recreate is the best bet, if you're using DBCs, you have to be careful, because the tag information is also used for persistent relationships in the database, so you can't just blow it away.

In that case, your best bet is to get Stonefield Database Toolkit ( and use its reindexing tool.

Tamar
 
Makes me wonder, Tamar.

You're right, I think I still have done this and I think if the final situation fits the DBC again you get no side effect of relations lost.

But that can easily be tested. Good advice to look out for that.

Anyway I best like the "hack" to store a CDX of the empty (at least almost empty) table, restore it and REINDEX. That's almost as ood as storing the meta data about the indexes, as SDT does.

This handling of the REINDEXING just fails for a later added TAG, as you can't empty the CDX to store a small footprint of the index info, once the DBF has grown. Then you need more trickery to create a table cope you can zap, reindex and then store that small cdx as your safe starting point. But it is possible.

Bye, Olaf.
 
REINDEX will not create .DBT bloat, but this will if the tag name already exists:
INDEX ON {expression} TAG {tagname)
 
Correction:
REINDEX will not create .CDX bloat, but this will if the tag name already exists:
INDEX ON {expression} TAG {tagname)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top