threefoldtecharchive / tfchain_explorer

explorer UI for grid 3
https://explorer.dev.grid.tf
2 stars 0 forks source link

Improve queries to graphql #147

Closed muhamadazmy closed 2 years ago

muhamadazmy commented 2 years ago

Currently, explorer creates one huge query against graphql that causes graphql to be very slow. It's better to create many smaller queries and leverage on server side aggregation (like counting nodes)

For example: Nodes and farms must be paginated. It means you fetch pages of nodes (let's say 20) and then on loading next page you fetch the next 20. and so on.

Counting of nodes and other objects must be done on server side.

abom commented 2 years ago

@AhmedHanafy725 @OmarElawady @waleedhammam please open other issues in https://github.com/threefoldtech/grid3_client_ts, https://github.com/threefoldtech/terraform-provider-grid and https://github.com/threefoldtech/tfgridclient_proxy

waleedhammam commented 2 years ago

gridproxy issue: https://github.com/threefoldtech/tfgridclient_proxy/issues/82

RafyAmgadBenjamin commented 2 years ago

Done

Branch

master_use_api_pagination

PR

https://github.com/threefoldtech/tfchain_explorer/pull/148

RafyAmgadBenjamin commented 2 years ago

image

old: 1.6 MB = 6 ~ 8 sec new: 40 KB / chunk = 1 ~ 2 sec

RafyAmgadBenjamin commented 2 years ago

Verified on

https://explorer.dev.grid.tf/

image