-
-
Notifications
You must be signed in to change notification settings - Fork 577
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
Try and maintain ordering of functions #2265
Merged
Merged
Changes from all commits
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
40458e6
Import reproduction
benjie 8bb1796
More maximal version
benjie 3988bb7
Snapshots
benjie c260152
What I think I am after
benjie d64c9a5
Fixed data
benjie 4fe1d5a
Push ordinality through for functions and natural ordering
benjie 3a306d0
Ordinality is natural
benjie 526806b
Refactor so that PgSelect handles ordinality
benjie 60f0cba
From now depends on orderBy due to ordinality
benjie 6041b6d
Actual implementation snapshot results
benjie 2d33d11
Fix formatting of comment
benjie 429c3a6
Only normal mode
benjie f854382
Just don't do joins if function has implicit order
benjie 1149dcd
Separate queries
benjie 2bb70ba
Update plans and exports
benjie b2669a5
Don't prevent lateral joins being inlined
benjie e4e5dc1
Restore lateral joins
benjie da53175
Back out another change
benjie cf5f1c8
Lint
benjie 66da090
Back out more changes
benjie 652a571
Allow overriding hasImplicitOrder alongside overriding from()
benjie 5d9f2de
docs(changeset): Prevents inlining (via joins) child PgSelect queries…
benjie 76b69b2
Revert "More maximal version"
benjie d6ee9ad
Update snapshots with more minimal test setup
benjie 89f5550
Sets are okay because we do them with subqueries, not joins
benjie 135e8c1
Allow inlining subqueries
benjie File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
--- | ||
"graphile-build-pg": patch | ||
"postgraphile": patch | ||
"@dataplan/pg": patch | ||
--- | ||
|
||
Prevents inlining (via joins) child PgSelect queries into parents when the | ||
parent is relying on implicit ordering coming from a function or suitably | ||
flagged subquery. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
64 changes: 64 additions & 0 deletions
64
postgraphile/postgraphile/__tests__/queries/v4/issue2210.json5
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
{ | ||
someMessages: { | ||
nodes: [ | ||
{ | ||
id: "<UUID 1>", | ||
message: "Bob says 3", | ||
createdAt: "2019-12-31T19:59:00.000000-04:00", | ||
testUserByTestUserId: { | ||
id: "<UUID 2>", | ||
name: "Bob", | ||
}, | ||
}, | ||
{ | ||
id: "<UUID 3>", | ||
message: "John says 3", | ||
createdAt: "2019-12-31T19:58:00.000000-04:00", | ||
testUserByTestUserId: { | ||
id: "<UUID 4>", | ||
name: "John", | ||
}, | ||
}, | ||
{ | ||
id: "<UUID 5>", | ||
message: "Bob says 2", | ||
createdAt: "2019-12-31T19:57:00.000000-04:00", | ||
testUserByTestUserId: { | ||
id: "<UUID 2>", | ||
name: "Bob", | ||
}, | ||
}, | ||
{ | ||
id: "<UUID 6>", | ||
message: "John says 2", | ||
createdAt: "2019-12-31T19:56:00.000000-04:00", | ||
testUserByTestUserId: { | ||
id: "<UUID 4>", | ||
name: "John", | ||
}, | ||
}, | ||
{ | ||
id: "<UUID 7>", | ||
message: "Bob says 1", | ||
createdAt: "2019-12-31T19:55:00.000000-04:00", | ||
testUserByTestUserId: { | ||
id: "<UUID 2>", | ||
name: "Bob", | ||
}, | ||
}, | ||
{ | ||
id: "<UUID 8>", | ||
message: "John says 1", | ||
createdAt: "2019-12-31T19:54:00.000000-04:00", | ||
testUserByTestUserId: { | ||
id: "<UUID 4>", | ||
name: "John", | ||
}, | ||
}, | ||
], | ||
pageInfo: { | ||
hasNextPage: false, | ||
endCursor: "WyJuYXR1cmFsIiw2XQ==", | ||
}, | ||
}, | ||
} |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
22 commits... but this is the bit that matters.