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

feat(assets): improve asset query #140

Merged
merged 4 commits into from
Feb 23, 2024

Conversation

1000101
Copy link
Contributor

@1000101 1000101 commented Feb 11, 2024

Improves /assets/:asset performance for assets with many mint txs.
Works by omitting inner JOIN ON multi_asset and replacing it with CTE (O(1)) for querying the given asset.
Basically ~ doubles the performance.

Sample (run on 16c):

Asset: 
e4214b7cce62ac6fbba385d164df48e157eae5863521b4b67ca71d866aa2153e1ae896a95539c9d62f76cedcdabdcdf144e564b8955f609d660cf6a2

BEFORE
 Execution Time: 250 ms

---

AFTER
 Execution Time: 80 ms

@1000101 1000101 force-pushed the 1000101/2402/assets_asset_optimization branch from 3298328 to aae2b1e Compare February 11, 2024 23:29
@1000101 1000101 force-pushed the 1000101/2402/assets_asset_optimization branch from aae2b1e to 703aa11 Compare February 12, 2024 00:39
@vladimirvolek vladimirvolek merged commit 0cab197 into master Feb 23, 2024
1 check passed
@vladimirvolek vladimirvolek deleted the 1000101/2402/assets_asset_optimization branch March 5, 2024 13:53
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.

3 participants