Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simple hash-join optimization #362

Closed
wants to merge 0 commits into from
Closed

Conversation

huahaiy
Copy link
Contributor

@huahaiy huahaiy commented Jul 24, 2020

In hash-join of two relations, a simple optimization is to create the hash table on the smaller side of the relations. This simple change can noticeably improve query performance in some cases.

For instance, if we change q2 of the benchmark from [:find ?e ?a :where [?e :name "Ivan"] [?e :age ?a]] to [:find ?e ?a :where [?e :sex ?a] [?e :name "Ivan"]]. On my machine, before this optimization, the query time is 9.5ms, after the optimization, it is 6.5ms.

Credit: This optimization is one of the techniques introduced in this paper:

Fan et al. 2019, Scaling-up in-memory datalog processing: observations and techniques, Proceedings of the VLDB Endowment, vol. 12. Full text: http://www.vldb.org/pvldb/vol12/p695-fan.pdf

@tonsky
Copy link
Owner

tonsky commented Jul 24, 2020

Thanks! Strange, I was sure I am already doing this :) Seems like not.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants