I think portalguy wrote: [Charset iso-8859-1 unsupported, filtering to ASCII...] > Hi, > After few attempts in jess script i gave up and did it in java, below is the > whole class with the function. I would like to know if doing it in java > rather than jess script will be > any slower? I'm calling it from jess script. >
[ Code to iterate over all facts deleted ] You've coded a linear search through working memory, and depending on how many facts you have, this could be very slow -- much slower than finding facts using a defquery. On the other hand, you can't use a defquery variable to stand in for the "head" of a fact, either, so if this were what you really needed to do, it would be very slow, but at least it would work. You need to look at how you're designing your application and figure out if this is something you really need to do -- and you should find that it's almost certainly not. This is akin to querying a database for the string "Green" in any table. Generally, you know whether you're interested in finding people named Greenstein, or instances of Greenbelt, Maryland, and you're virtually never interested in finding both at the same time. You really only want to search in a particular table. --------------------------------------------------------- Ernest Friedman-Hill Advanced Software Research Phone: (925) 294-2154 Sandia National Labs FAX: (925) 294-2234 PO Box 969, MS 9012 [EMAIL PROTECTED] Livermore, CA 94550 http://herzberg.ca.sandia.gov -------------------------------------------------------------------- To unsubscribe, send the words 'unsubscribe jess-users [EMAIL PROTECTED]' in the BODY of a message to [EMAIL PROTECTED], NOT to the list (use your own address!) List problems? Notify [EMAIL PROTECTED] --------------------------------------------------------------------
