<br><br><div class="gmail_quote">On 9 May 2012 19:52, soumya_sd <span dir="ltr"><<a href="mailto:soumya_sd@yahoo.com" target="_blank">soumya_sd@yahoo.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
laune wrote<br>
><br>
> Merely filtering a subset of data items from a collection according to<br>
> user's changing needs and whims is NOT the primary use case of a<br>
> production<br>
> rule system. This kind of problem has been solved adequately and<br>
> efficiently by SQL queries or some similar DB query technique.<br>
><br>
> It is true that such filtering rules, if compiled and stored in a<br>
> KnowledgeBase, can achieve the same thing, but, since rules are targeted<br>
> at<br>
> a more sophisticated use cases, this will never be as efficient as a<br>
> simple<br>
> query system.<br>
><br>
> -W<br>
><br>
><br>
<br>
you bring up an excellent point.<br>
<br>
What if the data is streaming in nature and is not stored in a database and<br>
outside of your control.<br></blockquote><div><br>It you can insert it into a WM, it can't be "outside of your control". If both data<br>and selection rules arrive at random, it's going to be chaotic. Some sort<br>
of higher order control pattern will have to take care of that...<br><br></div><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
<br>
Another approach is to cache the data locally (in a database) and then use<br>
SQL to filter it.<br>
<br>
I decided not to use the database approach because of two reasons.<br>
<br>
1. The database write operation may be expensive.<br></blockquote><div><br>Storing a record in a DB is not really expensive. <br> </div><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
2. In the future I may decide apply more complex consequence to my rules<br>
than just filtering.<br></blockquote><div><br>The effort for processing of selected entities is the same, irrespective of their source, be it <br>a DB or a WM. Compiling some processing statements could be done by invoking the<br>
Java compiler, without the additional overhead of compiling DRL first.<br><br>-W<br> </div><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
Thanks.<br>
<br>
--<br>
View this message in context: <a href="http://drools.46999.n3.nabble.com/Is-there-a-faster-way-of-doing-this-in-Drools-tp3973888p3974856.html" target="_blank">http://drools.46999.n3.nabble.com/Is-there-a-faster-way-of-doing-this-in-Drools-tp3973888p3974856.html</a><br>
Sent from the Drools: User forum mailing list archive at Nabble.com.<br>
_______________________________________________<br>
rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
</blockquote></div><br>