sigle / stxstats

Get the latest data from Stacks blockchain.
https://www.stxstats.co
30 stars 1 forks source link

feat: create custom query to generate number of txs #67

Closed pradel closed 2 years ago

pradel commented 2 years ago

Create a custom SQL query to generate the number of transactions per day. Old way execution time: 180s 495.067354ms New query execution time: 1s 359.967724ms

The new way is 180 times faster 🤯

Measured with:

  var hrstart = process.hrtime();
  const txsFeePerDay = await generateTxsFeePerDay();
  var hrend = process.hrtime(hrstart);
  console.info("Execution time (hr): %ds %dms", hrend[0], hrend[1] / 1000000);