<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=UTF-8" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Senlin Liang wrote:
<blockquote
 cite="mid:5e9db1b50810151558u3ab9ac0gb320bc0f4ca38974@mail.gmail.com"
 type="cite">
  <pre wrap="">My test query is

result(Index, PaperName, Author, Year, Month) :-
    paper(Index, name, PaperName),
    paper(Index, author, Author),
    paper(Index, year, Year),
    paper(Index, month, Month).

So drools builds alpha-hashing on the 2nd argument, and name-hashing
on the 1st argument.

Drools performs much more better than XSB/YAP for this query, and I am
trying to figure out what is the reason behind.
  </pre>
</blockquote>
I don't know the implementation details for XSB or YAP, so not much
more I can add other than what I've already said. Can't say it simpler
than we hash literal constraints and index variable constraints.<br>
<br>
Mark<br>
<blockquote
 cite="mid:5e9db1b50810151558u3ab9ac0gb320bc0f4ca38974@mail.gmail.com"
 type="cite">
  <pre wrap="">
Would you share some ideas?

Thanks,
Senlin

On Wed, Oct 15, 2008 at 5:40 PM, Mark Proctor <a class="moz-txt-link-rfc2396E" href="mailto:mproctor@codehaus.org">&lt;mproctor@codehaus.org&gt;</a> wrote:
  </pre>
  <blockquote type="cite">
    <pre wrap="">Senlin Liang wrote:

Thanks Mark!

I got another question: what kind of indexing is used in drools? what
field does it index?


It wil index the field used in the constraint
Person( name == "mark" )
Person( name == $var )

Both of those pattners will be indexed no the name field, the first is what
we call alpha node hashing, as it's on a literal and the latter is join node
index on the name field.

I checked the online manual, it seems that I uses hashing index, but i
am not sure the details.

The reason that I am asking this question is that: drools runs really
faster for one of my program. In this program, there is information
about DBLP publications:
   a(primary key, property, values), where primary key is the primary
key of one publication, property can be one of "author, year, ...",
and value is the value of the property. I run the query by joining the
tables together using the primary key. Drools runs really fast for
this program.

I am wondering whether there is anything behind to make drools fast.
Senlin

On Wed, Oct 15, 2008 at 3:41 PM, Mark Proctor <a class="moz-txt-link-rfc2396E" href="mailto:mproctor@codehaus.org">&lt;mproctor@codehaus.org&gt;</a> wrote:


Senlin Liang wrote:

One more question: does drools index intermediate results (such as the
inserted objects in actions)?


Any inserted object used in == constraints is indexed for that constraint.

Is there any cost-based optimization for queries?


no

Thanks

On Wed, Oct 15, 2008 at 9:10 AM, Senlin Liang <a class="moz-txt-link-rfc2396E" href="mailto:senlin.liang@gmail.com">&lt;senlin.liang@gmail.com&gt;</a>
wrote:


Hi all,

I got one question: How does drools index the objects in memory? Does
it use hashing index, based on what? Or drools uses adaptive indexing?

Thanks a lot,
Senlin





_______________________________________________
rules-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a>
<a class="moz-txt-link-freetext" href="https://lists.jboss.org/mailman/listinfo/rules-users">https://lists.jboss.org/mailman/listinfo/rules-users</a>






_______________________________________________
rules-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a>
<a class="moz-txt-link-freetext" href="https://lists.jboss.org/mailman/listinfo/rules-users">https://lists.jboss.org/mailman/listinfo/rules-users</a>


    </pre>
  </blockquote>
  <pre wrap=""><!---->


  </pre>
</blockquote>
<br>
</body>
</html>