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 GraphQL queries by adding additional indexes on DB level #1965

Open
xgreenx opened this issue Jun 14, 2024 · 0 comments
Open

Optimize GraphQL queries by adding additional indexes on DB level #1965

xgreenx opened this issue Jun 14, 2024 · 0 comments

Comments

@xgreenx
Copy link
Collaborator

xgreenx commented Jun 14, 2024

The source of this issue is #623.

Initially, the idea was to remove all complex queries from fuel-core and make it part of the indexer's responsibility. But the SDK is deeply integrated with these basic queries, that we need to support them on fuel-core. For that, we need to optimize the following queries by aggregating some information in the off-chain worker or adding new indexes to the database:

  • The balance and balances queries iterate over all entries of coins and messages in the storage. The off-chain worker should index the balance of each account and aggregate this information in a user-friendly form.
  • The coins_to_spend query is very complex and requires n^2 operations where n is the number of coins and messages. The algorithm itself can use additional indexes from RocksDB to solve the issue with dust coins and works fast.
  • The dry_run already allows the dry running of many transactions; we just need to forbid several dry run sub-queries inside of one query.
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

1 participant