Magickbase / godwoken_explorer

Godwoken Explorer
https://v1.gwscan.com
18 stars 9 forks source link

after waiting for a long time, the transaction list shows #1114

Closed gpBlockchain closed 1 year ago

gpBlockchain commented 2 years ago

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

image

Wait more than 10 seconds ,the transaction list shows

image
Naupio commented 2 years ago

use dataloader to solve graphql subfield n-query problem

Keith-CY commented 2 years ago

use dataloader to solve graphql subfield n-query problem

Please add the analysis or detailed reason along with the solution

Naupio commented 1 year ago

pr link: #1183

Naupio commented 1 year ago

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

  1. use the Batching Resolution by manuls
  2. use the Dataloader(refer to facebook graphql dataloader) infrastructure to solve the n+1 problem automatically
Keith-CY commented 1 year ago

Will be optimized by using Dataloader, tracked by issue https://github.com/Magickbase/godwoken_explorer/issues/1184 so this one could be closed