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

Optimize gsfa: store transactions per account relation for most recent 1000 transactions #37

Open
grooviegermanikus opened this issue Jan 8, 2024 · 1 comment
Assignees

Comments

@grooviegermanikus
Copy link
Collaborator

grooviegermanikus commented Jan 8, 2024

Add redundant table (next to accounts_map_transaction) which stores the most recent 1000 transactions per account.

Algorithm:

  1. take the transaction ids from current accounts_map_transaction_latest
  2. use the accounts and transactions from current block
  3. merge the two transaction id arrays (per acc_id):
    array_dedup_append('{8,3,2,1}', '{5,3}', 4) -> {2,1,5,3}
  4. update/insert into accounts_map_transaction_latest table
SELECT
	array_dedup_append('{8,3,2,1}', '{5,3}', 4),-- {2,1,5,3}
	array_dedup_append('{8,3,2,1}', '{5,3}', 10000) -- {8,2,1,5,3}
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

No branches or pull requests

2 participants