[rules-users] Re: Drools indexing

Senlin Liang senlin.liang at gmail.com
Wed Oct 15 18:58:29 EDT 2008


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.

Would you share some ideas?

Thanks,
Senlin

On Wed, Oct 15, 2008 at 5:40 PM, Mark Proctor <mproctor at codehaus.org> wrote:
> 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 <mproctor at codehaus.org> 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 <senlin.liang at gmail.com>
> 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
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
>
>
>
>
>
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
>



-- 
Senlin Liang



More information about the rules-users mailing list