Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Disabling indexes for a moment
Message
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00543126
Message ID:
00543149
Views:
25
>Here's a simple program I'm using in cases like this. Don't forget to remove space after << and before >>.

Thanks, Sergey. I was thinking along these lines, though this program should be a little bit complicated to deal with PRIMARY(), CANDIDATE(), DESCENDING() possible clauses. Anyway, perhaps, the main reason of slowness is all validations, which I have in this file. I don't know, how to disable them and perhaps I need to fire them while appending...
>PARAMETERS pcAlias, pcPrgName
>SET TALK OFF
>*-* Indexes
>cPrgName = IIF(EMPTY(pcPrgName), "zRecrInd", pcPrgName)
>cPrgName = IIF("." $ cPrgName , cPrgName , cPrgName + ".prg")
>SELECT (pcAlias)	
>
>* Process all indexes
>SET TEXT ON
>SET TEXT TO (cPrgName)
>
>\SET TALK OFF
>\* DBF=<< DBF() >>
>\SET TALK NOWIND
>\SET TALK ON
>\
>\? "Indexing:", DBF()
>\?
>
>
>FOR i = 1 TO TAGCOUNT()
>	m.Tag = TAG(I)
>	m.Key = KEY(i)
>	m.For = For(i)
>	
>	\? "Index << i >> << m.tag >> "  +  TIME()
>	IF EMPTY(m.For)
>		\INDEX ON << m.Key >> TAG << m.Tag >>
>	ELSE	
>		\INDEX ON << m.Key >> TAG << m.Tag >> FOR << m.For >>
>	ENDIF	
>
>ENDFOR
>
>SET TEXT TO
>SET TEXT OFF
>
>RETURN
>>Hi everybody,
>>
>>I have a file with lots of indexes. I have to append couple of files into this file. I'm using APPEND FROM command to append. This operation is very slow due to the indexes. Is there a simple way of "disabling" indexes for a moment?
>>
>>I'm thinking about renaming cdx temporary, do append operation, rename it back and do reindex. But it sounds like klugy approach, besides, file will give an error in attempt to open it.
>>
>>Can you suggest something here? It's for VFP6.0.
>>
>>Thanks in advance.
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform