From 6c3fe98443842955270ebd2206e141c950ad9b54 Mon Sep 17 00:00:00 2001 From: Etienne Donneger Date: Tue, 28 May 2024 14:35:41 -0400 Subject: [PATCH] Drop FINAL requirement for `transfers` queries (#33) --- src/usage.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/usage.ts b/src/usage.ts index 1d625a0..1ed66ea 100644 --- a/src/usage.ts +++ b/src/usage.ts @@ -40,13 +40,15 @@ export async function makeUsageQuery(ctx: Context, endpoint: UsageEndpoints, use query += `transfers_from `; } else if (q.to) { query += `transfers_to `; - } else if (q.contract) { + } else if (q.contract || q.symcode) { query += `transfers_contract `; } else { query += `transfer_events `; } - query += `FINAL`; + // FINAL increases ClickHouse query response time significantly when lots of data needs merging + // Drop it for now + //query += `FINAL`; } else if (endpoint == "/holders") { query += `SELECT DISTINCT account, value FROM eos_tokens_v1.account_balances FINAL WHERE value > 0`; } else if (endpoint == "/head") {