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

Improve the performance of IN checking #7410

Merged
merged 2 commits into from Jun 28, 2016
Merged

Conversation

systay
Copy link
Contributor

@systay systay commented Jun 17, 2016

This commit changes the output order of operations using hash codes,
such as hash joins, DISTINCT, and grouping for aggregation.

This is already in 3.1, so a null-merge should be done when forward merging.

changelog: [3.0, cypher] Improve the performance of IN checking.

This commit changes the output order of operations using hash codes,
such as hash joins, DISTINCT, and grouping for aggregation.
@systay
Copy link
Contributor Author

systay commented Jun 23, 2016

@spacecowboy How do I mark this PR so that it does not show up in the 3.1 changelog? It's a back-port of something that is already in 3.1 (and already in the changelog)

}

(eagerizedValue, eagerOther) match {
case (null, null) => true
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It says above that this class does not handle null values...? Which variables is that comment directed at?

@spacecowboy
Copy link
Contributor

spacecowboy commented Jun 23, 2016

@systay you have already done so by adding changelog: [3.0] ... (versions inside brackets are only for null-merges, otherwise never include them)


private def hashCode(o: Any): Int = o match {
case null => 0
case n: Number => n.longValue().hashCode()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Long zero has the hash code zero, so all numbers that go to a zero long will have the same hash code as null here. Given that zero might be the most commonly used number, wouldn't it make sense to give null another hash code, like -1, or Int.MAX_VALUE?

@Mats-SX Mats-SX merged commit a85aa90 into neo4j:3.0 Jun 28, 2016
@Mats-SX Mats-SX deleted the 3.0-cached-in branch June 28, 2016 08:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants