Closed gpBlockchain closed 1 year ago
use dataloader to solve graphql subfield n-query problem
use dataloader to solve graphql subfield n-query problem
Please add the analysis or detailed reason along with the solution
pr link: #1183
the transaction object has some subfields like
polyjuice subfield
polyjuice_creator subfield
from_account subfield
to_account subfield
block subfield
which will cause the transactions
api query slowly due ton+1 querys problem
.
there two way the fix this efficiency problem
Batching Resolution
by manulsDataloader
(refer to facebook graphql dataloader) infrastructure to solve the n+1
problem automaticallyWill be optimized by using Dataloader
, tracked by issue https://github.com/Magickbase/godwoken_explorer/issues/1184 so this one could be closed
url: https://v1.testnet.gwscan.com/account/0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266?tab=transactions The first time to query the transaction of the account,need a lot of time
Wait more than 10 seconds ,the transaction list shows