-
Notifications
You must be signed in to change notification settings - Fork 226
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
(PDB-5739) Reduce factsets "stable||volatile" merging #3972
Merged
Conversation
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
|
rbrw
force-pushed
the
pdb-5739-reduce-fact-merging
branch
2 times, most recently
from
May 7, 2024 16:37
f83ec9e
to
d8f2300
Compare
Previously this function could try to call .getSQLState on unrelated exceptions.
Noticed failing schema check in command-test output.
Since the other endpoints have to manufacture a synthetic representation of the data (i.e. flattened key/values, etc.) and so are likely to be more expensive, at least when a large number of factsets is involved.
rbrw
force-pushed
the
pdb-5739-reduce-fact-merging
branch
2 times, most recently
from
May 13, 2024 22:49
329680e
to
e9de9b1
Compare
Since we've observed that the || operation can be expensive, and we don't actually want a full factset map here (we want the individual top-level subtrees), rewrite it as a union. This shouldn't change anything material since pdb ensures the two key sets are disjoint. This also assumes that it's not important to be compatible with the existing stable||volatile index here. The existing query could only have been using the index if postgres is clever enough to see all the way through the name -> key (via jsonb_each/.*) operations to identify cases where the index might be relevant.
Since we've observed that the || operation can be expensive, and we don't actually want a full factset map here (we want the individual top-level subtrees), rewrite it as a union. This shouldn't change anything material since pdb ensures the two key sets are disjoint. This also assumes that it's not important to be compatible with the existing stable||volatile index here. The existing query could only have been using the index if postgres is clever enough to see all the way through the recursive CTE, name -> key (via jsonb_each/.*) operations to identify cases where the index might be relevant.
Since we've observed that the || operation can be expensive, and we don't actually want a full factset map here (we want the individual top-level subtrees), rewrite it as a union. This shouldn't change anything material since pdb ensures the two key sets are disjoint. This also assumes that it's not important to be compatible with the existing stable||volatile index here. The existing query could only have been using the index if postgres is clever enough to see all the way through the json_agg -> json_build_object -> name -> key (via jsonb_each/.*) operations to identify cases where the index might be relevant.
Add a missing hsql case.
Since we've observed that the || operation can be expensive, and we don't actually want a full factset map here (we want the individual top-level subtrees), rewrite it as a union. This shouldn't change anything material since pdb ensures the two key sets are disjoint. This also assumes that it's not important to be compatible with the existing stable||volatile index here. The existing query could only have been using the index if postgres is clever enough to see through the key (via jsonb_each/.*) operation to identify cases where the index might be relevant.
Produce an hsql vector, not a lazy seq.
rbrw
force-pushed
the
pdb-5739-reduce-fact-merging
branch
from
May 14, 2024 17:00
e9de9b1
to
9df5ae2
Compare
austb
approved these changes
May 14, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Without more potentially substantial changes to the query engine, we can't drop all the merging (e.g. the facts projection from the inventory endpoint) and switch to independent stable and volatile indexes, so for now, just consider some incremental changes along those lines.
cf. #3955