Thank you to all. I think Henry insight, supported by others is the core of what I was looking for. I appreciate all input frm all parties.
Barry Rogen PNY Technologies, Inc. Senior Programmer/Analyst (973) 515 - 9700 ext 5327 [email protected] ----------------------------------------------------- We are continually faced with great opportunities brilliantly disguised as insoluble problems. John W Gardner ---------------------------------------------------------------- P Before printing please think about your environmental responsibility -----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of andy baum Sent: Friday, July 17, 2009 5:21 AM To: U2 Users List Subject: Re: [U2] Universe Retrieve Henry, Yes, I did some more testing myself last night, should have replied sooner. I built a file with a million records and repeated the test, I also created an I-Descriptor on the dictionary and got the following results :- COUNT TESTFILE WITH F1 = "v" Elapsed 2.828 CPU 2.171 COUNT TESTFILE WITH F1 = EVAL "'V'" Elapsed 8.953 CPU 6.625 COUNT TESTFILE WITH F1 = VEE.ITYPE Elapsed 8.766 CPU 6.500 Which seems to confirm what you are saying Cheers, Andy ----- Original Message ---- From: Henry Unger <[email protected]> To: U2 Users List <[email protected]> Sent: Friday, 17 July, 2009 0:32:03 Subject: Re: [U2] Universe Retrieve Good point, Andy. I had considered that, but guessed that it would not be a significant factor. Just in case, I created a file with a million records, and reran the tests. Here are the results: COUNT TESTFILE WITH F1 = 'V' Elapsed 7.4796 COUNT TESTFILE WITH F1 = EVAL "'V'" Elapsed 23.2558 Seems pretty consistent with the earlier tests. Best regards, Henry Henry P.. Unger Hitech Systems, Inc. http://www.hitech.com -----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of andy baum Sent: Thursday, July 16, 2009 2:52 PM To: U2 Users List Subject: Re: [U2] Universe Retrieve Henry, EVAL compiles the expression and writes the result into the dictionary, runs the query and then deletes the dictionary item. For your test to be valid you would need to ignore the overheads of the compile, write to and delete from dictionary which in your example are significant compared to the number of records counted. You could probably get more accurate results by choosing an example that runs against a file with millions of records. Cheers, Andy ----- Original Message ---- From: Henry Unger <[email protected]> To: U2 Users List <[email protected]> Sent: Thursday, 16 July, 2009 18:36:27 Subject: Re: [U2] Universe Retrieve Hi Martin, I was under the impression that an EVAL calls the same compiler that an I-type does, and that any expression optimization would be done therein. Expanding beyond that, it would be interesting if the I-type compiler was able to detect that a particular expression does result in a constant value and flag the object code as not requiring repeated evaluation by the query processor. Here are some empirical results using UniVerse 10.2.7: >TIMEIT 50 COUNT VOC WITH F1 = 'V' COUNT VOC WITH F1 = 'V' Elapsed 1.3006 >TIMEIT 50 COUNT VOC WITH F1 = EVAL "'V'" COUNT VOC WITH F1 = EVAL "'V'" Elapsed 5.135 This suggests that the query processor does not detect that the result of the evaluation is a constant and optimize its execution. Best regards, Henry TIMEIT: sent = @SENTENCE rest = trimf(field(sent, ' ', 2, len(sent))) word = field(rest, ' ', 1) if word matches "0N" then n = int(word) sent = trimf(field(rest, ' ', 2, len(rest))) end else n = 1 sent = rest end print sent t0 = time() for i = 1 to n execute sent capturing output next t1 = time() print 'Elapsed ' : t1 - t0 end Henry P. Unger Hitech Systems, Inc. http://www.hitech.com -----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Martin Phillips Sent: Thursday, July 16, 2009 9:30 AM To: U2 Users List Subject: Re: [U2] Universe Retrieve Hi Henry, > You can see the object code that is produced using VLIST and > examine it for optimizations. The particular optimsiation that Barry is looking for would not show in the object code. For a truly constant I-type expression, the query procesor could evaluate it just once and store the result instead of doing it on every use. Although not common, such I-types do exist. Martin Phillips Ladybridge Systems Ltd 17b Coldstream Lane, Hardingstone, Northampton, NN4 6DB +44-(0)1604-709200 _______________________________________________ U2-Users mailing list [email protected] http://listserver.u2ug.org/mailman/listinfo/u2-users _______________________________________________ U2-Users mailing list [email protected] http://listserver.u2ug.org/mailman/listinfo/u2-users _______________________________________________ U2-Users mailing list [email protected] http://listserver.u2ug.org/mailman/listinfo/u2-users _______________________________________________ U2-Users mailing list [email protected] http://listserver.u2ug.org/mailman/listinfo/u2-users _______________________________________________ U2-Users mailing list [email protected] http://listserver.u2ug.org/mailman/listinfo/u2-users 17/7/2009NOT INTENDED AS A SUBSTITUTE FOR A WRITING NOTHING IN THIS E-MAIL, IN ANY E-MAIL THREAD OF WHICH IT MAY BE A PART, OR IN ANY ATTACHMENTS THERETO, SHALL CONSTITUTE A BINDING CONTRACT, OR ANY CONTRACTUAL OBLIGATION BY PNY, OR ANY INTENT TO ENTER INTO ANY BINDING OBLIGATIONS, NOTWITHSTANDING ANY ENACTMENT OF THE UNIFORM ELECTRONIC TRANSACTIONS ACT, THE FEDERAL E-SIGN ACT, OR ANY OTHER STATE OR FEDERAL LAW OF SIMILAR SUBSTANCE OR EFFECT. THIS EMAIL MESSAGE, ITS CONTENTS AND ATTACHMENTS ARE NOT INTENDED TO REPRESENT AN OFFER OR ACCEPTANCE OF AN OFFER TO ENTER INTO A CONTRACT. NOTHING IN THIS E-MAIL, IN ANY E-MAIL THREAD OF WHICH IT MAY BE A PART, OR IN ANY ATTACHMENTS THERETO SHALL ALTER THIS DISCLAIMER. This e-mail message from PNY Technologies, Inc. is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply e-mail and destroy all copies of the original message. _______________________________________________ U2-Users mailing list [email protected] http://listserver.u2ug.org/mailman/listinfo/u2-users
