Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SEEK(),INDEXSEEK() or KeyMatch() or SELECT-SQL?
Message
 
 
To
11/04/2005 11:54:48
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:
01003424
Views:
19
>>I'm only going to try number 2. I'm going to run just few tests, because this issue is taking too much of my time. We discussed this problem today on our programming meeting. I told, that I want to use help of one other programmer and want to do a parallel programming with him. Basically, it's obvious to me that there is a bug in the existing code, which I need to trace first. Why I know about the bug? Well, it's easy: in my tests I was changing the value of cEntered_User field. This field is not engaged in any relations, but yet I ended up with lots of tables open. So there is clearly a bug which we have to trace. Once this done, I want to modify the builder, so it would create a table in the DBC() path called RIDefinitions. In this table I would only put those RI that have R or C. E.g. this table will have fewer records than number of relations, because more than half of them have Ignore for all three types. I also put Key expressions for both parent and child, so I would not need
>to
>> resolve them at run-time. So all these changes are going to speed up the trigger's code. I still would have just one procedure.
>>
>>That's my plan, now I'm going to call my colleague and start implementing it.
>>
>>Thanks again for lots of useful ideas.
>_______________
>
>Some rules need two functions, eg a restrict on a child insert implies a restrict on the parent update
>_______________
>about that tables open thing (cEntered_User field)
>
>I have not gone through all the code, just throwing in some ideas, but opening tables that are not needed may have some causes
>
>(1) open a related child table when there is no delete trigger
>(2) open a realted parent table when there is no insert trigger
>
>(3) open a related parent and/or child table for an update trigger when the index has not changed, eg
>
>function _Trigger_Process_Relation_Parent_Update_Restrict
>		lparameters	TRIGGERRELATION_PARAMETERLIST
>
>	local Success, sOther, _error_msg, s, ParentValue
>	Success = TRUE
>	s = select(0)
>	ParentValue = oldval(m.thisIndexExpr)
>	
>	do case
>	case !m.Success
>	
>	case eval(m.thisIndexExpr) == m.ParentValue
>		&& not changed                         &&& HERE, it falls through, not opening anything
>
>        case !_TriggerOpen(@sOther, m.OtherTable, m.OtherTag )
>		Success = FALSE
>			
>	otherwise
>          ....
>        endcase
>
>
>       return (m.Success and NO_ERROR)
>
>
>

Right. I did some tests and it doesn't open all tables when it's not needed. I think, it was done before... Anyway, it's currently evaluating key field for all tables and it should be done just once if it is the same key field.
If it's not broken, fix it until it is.


My Blog
Previous
Reply
Map
View

Click here to load this message in the networking platform