Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SEEK(),INDEXSEEK() or KeyMatch() or SELECT-SQL?
Message
 
 
To
13/04/2005 13:54:45
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Miscellaneous
Thread ID:
01002645
Message ID:
01004286
Views:
38
>>Do you mean that all operations which involve numbers (in this case simple integers) are faster comparing with char vars? What is logical versa 1/0 ? We currently have iActive_Flag in lots of tables...
>
>You don't have chars, you have strings size 1. Strings are "normal" vfp-vars pointing to some memory... Best read up in the description of the c-interface (even in some old FPW-books!), that is (at least for me) easiest to comprehend. But you remind me of another option for the "I", "R": reading out asc(tablevar) into a numerical memory variable and comparing that to numerical constants is another option.
>
I'm just going to believe you then... If I find a book, which describes it, I'll read it up, of course.


>>>>>d)
>>>No, I meant considering to open the relevant tables if possible only once. I haven't tried to follow the code exactly, but there was a session object involved. Is it possible to keep the tables open in this isolation during the whole runtime of the app or the isolated form ? Open on first need for RI and close at the very end ?
>>
>>It's obvious it could be better to open all tables once. But it should be done in each particular batch procedure before calling any update data functions. Since I can not guarantee, it was done, I have to code around it. BTW, Steve's code does have all tables opened only once and he left them opened after the trigger finished. In my opinion, everything should be self-contained, e.g. if the procedure opened something, it should close it.
>
>I'm with you 150% on striving for self-contained code. But "use" can be terribly expensive in some network scenarios (we are talking quite a few ms here). Imagine RI defined to work only on opened tables and a "contract" to open all RI-connected tables once whenever one of those tables is opened. A builder could fill a field in your RI table describing all "other" tables... This is could be viewed as a caching strategy - but if you sometimes need just to read from one table, it could backfire. Not enough knowledge about your app to give seasoned advise. Measure again and rethink...

Well, for my tests I can run them with tables opened and without.
>>
>>That was one of my questions in this thread, that Fabio and Gregory answered is not possible to achieve. My question was, is it possible to determine entry point and exit poin in REPLACE (or other commands) of this nature.
>
>Must read that part of the thread...
>
>>I have one procedure, which I use for my tests:
>But the 200umph relation dbc/tables combo is missing, the table size[s] and other indices [deleted()] might influence the timings... and you should take 10 minutes to pump up your test cases if you spent that much time already!
>
>>E.g. I have a code SCAN while !empty(m.lcError). First time it works, but the second time it obviously did not because I don't have go top before that scan:)
>
>Haven't checked what place in your code your talking about, but While always implies scope REST - otherwise the seek() scan rest while wouldn't work - which would be a pity ;-)
>

It's actually from another program. I found one such case already in the same code, but missed another one. Anyway, tracing the code today I discovered it. It's better some day, than never < g >
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