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

[Feature Branch] Aggregation 6 #5945

Draft
wants to merge 60 commits into
base: dev
Choose a base branch
from
Draft

[Feature Branch] Aggregation 6 #5945

wants to merge 60 commits into from

Conversation

angrykoala
Copy link
Member

Description

This PR adds the new aggregate operations inside connections and deprecates the old aggregate operations

Copy link

changeset-bot bot commented Jan 23, 2025

🦋 Changeset detected

Latest commit: 98bf3bc

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@neo4j/graphql Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@neo4j-team-graphql
Copy link
Collaborator

neo4j-team-graphql commented Feb 18, 2025

Performance Report

name dbHits old dbHits time (ms) old time (ms) maxRows
🟥 aggregations.TopLevelAggregateWithMultipleFields 9071 6802 112 61 1134
🟥 aggregations.NestedAggregation 23063 15407 121 85 2174
🟦 aggregations.TopLevelAggregateWithMultipleFieldsDeprecated 6802 N/A 49 N/A 1134
🟦 aggregations.NestedAggregationDeprecated 15407 N/A 58 N/A 2174
🟦 2871.NestedRelationshipFilter 19632 N/A 62 N/A 4395
🟦 2925.NestedSingleRelationshipFilter 17641 N/A 76 N/A 2174
🟦 2925.NestedSingleRelationshipRequiredFilter 9361 N/A 56 N/A 1040
🟦 query.OrFilterOnRelationshipsAndNested 26747 N/A 188 N/A 2027

🟥 - Performance worsened (dbHits)
🟩 - Performance improved (dbHits)
🟦 - New test

Show Full Table
name dbHits old dbHits time (ms) old time (ms) maxRows
aggregations.TopLevelAggregate 3404 3404 39 57 1134
🟥 aggregations.TopLevelAggregateWithMultipleFields 9071 6802 112 61 1134
🟥 aggregations.NestedAggregation 23063 15407 121 85 2174
🟦 aggregations.TopLevelAggregateWithMultipleFieldsDeprecated 6802 N/A 49 N/A 1134
🟦 aggregations.NestedAggregationDeprecated 15407 N/A 58 N/A 2174
aggregations.AggregationWithWhere 10833 10833 42 68 2174
aggregations.AggregationWhereWithinNestedRelationships 20097917 20097917 1965 2048 2008534
aggregations.AggregationWhereWithinNestedConnections 20097917 20097917 2043 2025 2008534
aggregations.NestedCountFromMovieToActors 8603 8603 36 51 2174
aggregations.NestedCountFromActorsToMovie 8791 8791 39 53 2174
aggregations.DeeplyNestedCount 10052335 10052335 2892 3213 2008534
aggregations.InterfacesAggregations 6242 6242 51 61 2080
aggregations.InterfacesAggregationsWithTwoFields 11444 11444 87 114 2080
batch-create.BatchCreate 4200 4200 130 172 600
batch-create.BatchCreateSmall 77 77 62 71 11
connect.createAndConnect 6433 6433 129 308 3003
connections.Connection 12951 12951 62 78 2174
connections.NestedConnection 37705 37705 125 145 4516
create.SimpleMutation 7 7 53 68 1
cypher-directive.TopLevelMutationDirective 1135 1135 25 39 1134
delete.SimpleDelete 19401 19401 657 783 1040
🟦 2871.NestedRelationshipFilter 19632 N/A 62 N/A 4395
2925.SingleRelationshipFilter 5245 5245 40 55 1040
🟦 2925.NestedSingleRelationshipFilter 17641 N/A 76 N/A 2174
2925.SingleRelationshipRequiredFilter 5201 5201 40 50 1040
🟦 2925.NestedSingleRelationshipRequiredFilter 9361 N/A 56 N/A 1040
query.SimpleQuery 3121 3121 21 24 1040
query.SimpleQueryWithRelationship 15031 15031 41 52 2174
query.SimpleQueryWithNestedWhere 8713 8713 48 63 2154
query.Nested 10084891 10084891 6713 6736 2008534
query.NestedWithFilter 10064992 10064992 6528 6605 2004000
query.OrFilterOnRelationships 36946 36712 151 187 2027
🟦 query.OrFilterOnRelationshipsAndNested 26747 N/A 188 N/A 2027
query.QueryWithNestedIn 14468 14468 54 79 1956
query.NestedConnectionWhere 8703 8703 53 69 2174
query.DeeplyNestedConnectionWhere 8702 8702 76 96 2174
query.DeeplyNestedWithRelationshipFilters 17357 17357 129 234 1552
query.NestedWithRelationshipSingleFilters 3808 3808 174 240 1134
query.Fulltext 64 64 33 41 16
query.FulltextWithNestedQuery 516 516 63 51 84
sorting-and-cypher.TopLevelSortWithCypher 12961 12961 40 54 2174
sorting-and-cypher.TopLevelConnectionSortWithCypher 12961 12961 64 73 2174
sorting-and-cypher.TopLevelSortWithCypherWithNested 13096 13096 54 70 2174
sorting-and-cypher.TopLevelConnectionSortWithCypherWithNested 13096 13096 99 114 2174
sorting-and-cypher.TopLevelSortWithExpensiveCypher 13720 13720 94 134 2174
sorting-and-cypher.TopLevelConnectionSortWithExpensiveCypher 13266 13266 97 129 2174
sorting.SortMultipleTypes 3436 3436 88 96 1040
sorting.SortMultipleTypesWithCypherWithCypher 13321 13321 100 126 2174
sorting.SortOnNestedFields 12951 12951 43 63 2174
sorting.SortDeeplyNestedFields 39785 39785 82 124 4516
sorting.ConnectionWithSort 3271 3271 74 86 1040
unions.SimpleUnionQuery 321 321 56 66 35
unions.SimpleUnionQueryWithMissingFields 293 293 55 66 35
unions.NestedUnion 309975 309975 250 280 33033
unions.NestedUnionWithMissingFields 283949 283949 243 266 33033
update.NestedUpdate 14137 14137 103 124 2002

Old Schema Generation: 31.128s
Schema Generation: 29.514s
Old Subgraph Schema Generation: 30.356s
Subgraph Schema Generation: 30.198s

@angrykoala angrykoala changed the title Aggregation 6 [Feature Branch] Aggregation 6 Feb 18, 2025
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ [eslint] <jest/no-disabled-tests> reported by reviewdog 🐶
Disabled test

test.skip("aggregation", async () => {
const query = `
{
productionsAggregate(where: { OR: [ { typename: [${Movie.name}, ${Series.name}] } { typename: [${Cartoon.name}] } ] }) {
count
}
}
`;
const queryResult = await testHelper.executeGraphQL(query);
expect(queryResult.errors).toBeUndefined();
expect(queryResult.data).toEqual({
productionsAggregate: {
count: 3,
},
});
});

Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ [eslint] <jest/no-disabled-tests> reported by reviewdog 🐶
Disabled test

test.skip("nested aggregation", async () => {
const query = `
{
${Actor.plural} {
actedInAggregate(where: { NOT: { typename: [${Movie.name}, ${Series.name}] } }) {
count
}
}
}
`;
const queryResult = await testHelper.executeGraphQL(query);
expect(queryResult.errors).toBeUndefined();
expect(queryResult.data).toEqual({
[Actor.plural]: expect.arrayContaining([
{
actedInAggregate: {
count: 1,
},
},
]),
});
});

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.

2 participants