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: denormalize addresses on transactions to improve read #351

Merged
merged 6 commits into from
Oct 19, 2022

Conversation

flemzord
Copy link
Member

@flemzord flemzord commented Oct 17, 2022

Improve transactions search

Currently, reading transactions filtering using account/source/destinations filters is pretty slow.
The queries has to unpack postings to be able to filter on them.
But this processing is quite consuming.

This PR add two new columns on transactions :

  • sources
  • destinations

Both of these columns aggregate sources and destinations from all postings.
This way, the queries can rely on those columns directly instead of unpack postings.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Refactoring / Technical debt

@codecov
Copy link

codecov bot commented Oct 17, 2022

Codecov Report

Merging #351 (3a85a66) into main (6f450af) will decrease coverage by 0.14%.
The diff coverage is 95.71%.

@@            Coverage Diff             @@
##             main     #351      +/-   ##
==========================================
- Coverage   68.08%   67.94%   -0.15%     
==========================================
  Files          93       93              
  Lines        5910     5961      +51     
==========================================
+ Hits         4024     4050      +26     
- Misses       1534     1562      +28     
+ Partials      352      349       -3     
Impacted Files Coverage Δ
pkg/storage/sqlstorage/schema.go 81.25% <25.00%> (-2.09%) ⬇️
pkg/storage/sqlstorage/aggregations.go 64.22% <100.00%> (ø)
pkg/storage/sqlstorage/transactions.go 81.65% <100.00%> (+2.53%) ⬆️
pkg/storage/sqlstorage/sqlite.go 28.45% <0.00%> (-21.96%) ⬇️
pkg/analytics/segment.go 57.77% <0.00%> (+3.70%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@flemzord flemzord changed the title wip: test to denormalize addresses on transactions to improve read pe… feat: denormalize addresses on transactions to improve read Oct 19, 2022
@flemzord flemzord marked this pull request as ready for review October 19, 2022 13:05
@flemzord flemzord merged commit b9358f2 into main Oct 19, 2022
@flemzord flemzord deleted the feat/denormalize-transactions-addresses branch October 19, 2022 15:33
flemzord added a commit that referenced this pull request Oct 20, 2022
* wip: test to denormalize addresses on transactions to improve read performance

* fix: sql insert

* fix: extension init

* fix: sqlite support

* clean: some debug

* fix: remove insertTransaction segfault protection

Co-authored-by: Geoffrey Ragot <geoffrey.ragot@gmail.com>
Co-authored-by: Antoine Gelloz <antoine.gelloz@me.com>
@gfyrag gfyrag mentioned this pull request Jan 28, 2023
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