Couple of performance Questions

Krokodile

New Member
I took a test recently and there were these 2 Q:-

Q. Do you think it is appropriate to use the ‘LIKE’ option on variable and temp-table definitions?
I favoured LIKE option and told about how it inherits all the attributes of DB field or table. etc etc..


Q. Which function is best CAN-DO or LOOKUP? Discuss personal preference and why.
I favoured LOOKUP as it gives me the resulting position in an INTEGER based on that i can make some business logic IF THEN ELSE.


What are your takes on this.

Thanks.
 
My views are as below;

1. The overhead of using 'LIKE' keyword is that you need to define a word index, which obviously occupies some xtra space.

2. If would prefer to use CAN-DO() since it returns true or false. LOOKUP() gives you the position where your string exist in search string. This means it has to first find whether the value exist and if exist extract the position where it exists and give it to the user.

I would appreciate if more Progress guru's can give their views.

Thanks,
Ajay.
 
My Personal Preference is:

1. I use the LIKE keyword allot on TEMP-TABLES, but not much on individual variables. I like LIKE. :)

2. I use the CAN-DO way too much. In fact I made another version of it as a user defined function to compare lists with lists. (EX: CanDo2("Me,Oh,My","Me,Like"). The BIG downside to using CAN-DO's, Matches, IF's, and etc in a FOR EACH statement can cause a BIG performance hit because PROGRESS ignores all indexes and processes every record in the table to see if it qualified the WHERE statement.

For Example:
FOR EACH table WHERE CAN-DO("AMCE,ABC",table.char-field-in-index) :: Slow
FOR EACH table WHERE (table.char-field-in-index = "AMCE" OR table.char-field-in-index = "ABC") :: Faster

Bradley Worrell-Smith
http://www.stompfest.com
 
Back
Top