Skip to content

Conversation

@xiaojieyang
Copy link
Contributor

No description provided.

@neo-technology-commit-status-publisher
Copy link
Collaborator

Looks like you've updated the documentation!

Check out your changes at https://neo4j-docs-cypher-395.surge.sh

@xiaojieyang xiaojieyang added the cherry-pick-this-to-5.x Cherry pick this PR changes to the 5.x branch label Feb 9, 2023
Copy link
Contributor Author

Choose a reason for hiding this comment

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

change Query into:
PROFILE
MATCH (bob:Person {name: 'Bob'})-[:WORKS_IN]->(loc)<-[:WORKS_IN]-(matt:Person {name: 'Mattias'}) USING JOIN ON loc
RETURN loc.name

@stefano-ottolenghi
Copy link
Contributor

One last query plan due to a change happened in January, where Eager was applied to full node returns as well (previously was only on properties) https://trello.com/c/I3ygMZHW/917-eagerness-consider-returning-full-entity-a-read

@stefano-ottolenghi stefano-ottolenghi merged commit 87c5914 into neo4j:dev Feb 9, 2023
@stefano-ottolenghi stefano-ottolenghi deleted the fix-operator-plan branch February 9, 2023 16:00
JPryce-Aklundh pushed a commit that referenced this pull request Apr 13, 2023
To a good extent, this is a rollback of #395.

This investigation started with the query plan of `CacheProperties`
being wrong since... well, there was no `CacheProperties` operator in
the plan. The testing was happy that way, which was odd. It turned out
that it was because of the example query in the `Eager` operator, which
effectively _cleared_ the database, so that all examples afterwards ran
on an empty db. `CacheProperties` comes after `Eager` in the operators
page, so that the `CacheProperties` example ran on an empty db.

Summary of changes:
- Changed `Eager` example so that it deletes only _two_ nodes, rather
than _all_ nodes. The query plan is essentially unchanged, other than
indexes being used. Most notably, `Eager` is still triggered, presumably
as the db doesn't know upfront how many nodes have that property value
anyway.
- Fixing the above triggered a bunch of failures (for `CacheProperties`,
`EagerAggregation`, `Distinct`) , which are essentially the plans
changed in #395. I've restored them as they were before, but not altered
them otherwise.
- Given proper names to indexes/constraints, describing what they
_index_ rather than what they _test_.
- Moved the setup queries _inside_ the sections they belong to, rather
than _before_ the respective openings.
- Removed a setup block that dropped and recreated the exact same index.
- The `Delete` example was acting on `(me:Person {name: 'me'})`, which
has relationships attached to it, so an error is raised. Or rather, no
failure used to happen because, previously, the `Eager` example cleared
the whole db, so `DELETE me` was deleting a non-existent node, and now
the `Eager` example `DETACH DELETE`s the `me` node, so that it keeps not
existing. However, if for whatever reason we changed some of the
examples involved and it turned out that `me` existed with relationships
(as the page setup creates), then we'd get a failure. So I've changed
the `DELETE` example to act on `you`, rather than `me`, as `you` never
exists. There's also some perverse joy involved with pretending to
obliterate the reader, so I like it better.
JPryce-Aklundh pushed a commit to JPryce-Aklundh/docs-cypher that referenced this pull request Apr 13, 2023
To a good extent, this is a rollback of neo4j#395.

This investigation started with the query plan of `CacheProperties`
being wrong since... well, there was no `CacheProperties` operator in
the plan. The testing was happy that way, which was odd. It turned out
that it was because of the example query in the `Eager` operator, which
effectively _cleared_ the database, so that all examples afterwards ran
on an empty db. `CacheProperties` comes after `Eager` in the operators
page, so that the `CacheProperties` example ran on an empty db.

Summary of changes:
- Changed `Eager` example so that it deletes only _two_ nodes, rather
than _all_ nodes. The query plan is essentially unchanged, other than
indexes being used. Most notably, `Eager` is still triggered, presumably
as the db doesn't know upfront how many nodes have that property value
anyway.
- Fixing the above triggered a bunch of failures (for `CacheProperties`,
`EagerAggregation`, `Distinct`) , which are essentially the plans
changed in neo4j#395. I've restored them as they were before, but not altered
them otherwise.
- Given proper names to indexes/constraints, describing what they
_index_ rather than what they _test_.
- Moved the setup queries _inside_ the sections they belong to, rather
than _before_ the respective openings.
- Removed a setup block that dropped and recreated the exact same index.
- The `Delete` example was acting on `(me:Person {name: 'me'})`, which
has relationships attached to it, so an error is raised. Or rather, no
failure used to happen because, previously, the `Eager` example cleared
the whole db, so `DELETE me` was deleting a non-existent node, and now
the `Eager` example `DETACH DELETE`s the `me` node, so that it keeps not
existing. However, if for whatever reason we changed some of the
examples involved and it turned out that `me` existed with relationships
(as the page setup creates), then we'd get a failure. So I've changed
the `DELETE` example to act on `you`, rather than `me`, as `you` never
exists. There's also some perverse joy involved with pretending to
obliterate the reader, so I like it better.
lidiazuin pushed a commit to lidiazuin/docs-cypher that referenced this pull request May 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cherry-pick-this-to-5.x Cherry pick this PR changes to the 5.x branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants