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

Datalog performance #2

Open
robert-stuttaford opened this issue Aug 1, 2013 · 1 comment
Open

Datalog performance #2

robert-stuttaford opened this issue Aug 1, 2013 · 1 comment

Comments

@robert-stuttaford
Copy link
Collaborator

In http://localhost:3000/chapter/2: "The order of the data patterns does not matter (except possibly for performance)"

It definitely matters :-) Datalog has no query optimiser; it'll execute clauses in the order given and take as long as it needs to do that. You should place your most restrictive clauses at the top so that successive clauses have less data to operate on.

Depending on the shape of your data, you can see orders of magnitude difference in query performance!

@jonase
Copy link
Owner

jonase commented Aug 2, 2013

You're right that it's very important to consider the clause order when writing real world queries. However, I don't want to be bogged down in perfomance discussions this early in the tutorial. Maybe a link to an external performance/clause-order discussion or a separete perfomance chapter later on in the tutorial.

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

No branches or pull requests

2 participants