-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
export transactions csv export slow #336
Comments
ReasonThe table only needs to export the capacity corresponding to cell_inputs and cell_outputs corresponding to ckb_transaction, but the display_inputs and display_outputs that are called now will cause additional query of table blocks and udts. Solution
inputs =
if ckb_transaction.is_cellbase
return [""]
else
cell_inputs_for_display = ckb_transaction.inputs.to_a.sort_by(&:id)
cell_inputs_for_display.map(&:capacity)
end
cell_outputs_for_display = ckb_transaction.outputs.to_a.sort_by(&:id)
outputs = cell_outputs_for_display.map(&:capacity) EffectLocally query the staging environment address --> Api::V1::AddressTransactionsController download_csv
user system total real
1.151034 0.345807 1.496841 ( 12.128878) |
Related PR: nervosnetwork/ckb-explorer#1301 |
Exporting transactions to csv is too slow, queries take too long, and the web interface doesn't give any hints.
Related issues:
#41
Related pull requests:
Magickbase/ckb-explorer-frontend#9
nervosnetwork/ckb-explorer#1241
The text was updated successfully, but these errors were encountered: