Query editor
-- Daily TPS per chain over the last year-- Efficiency: single window CTE, partition pruning on *_date, no per-row date_trunc where a date column existsWITH ranges AS (SELECTCAST(date_trunc('day', current_timestamp - INTERVAL '1' YEAR) AS date) AS date_from,CAST(date_trunc('day', current_timestamp) AS date) AS date_to),all_tx AS (-- ============= EVM & L2s with block_date =============SELECT block_date AS date, 'ethereum' AS blockchain, COUNT(*) AS txsFROM ethereum.transactions t CROSS JOIN ranges rWHERE t.block_date BETWEEN r.date_from AND r.date_toGROUP BY 1UNION ALLSELECT block_date, 'celo', COUNT(*) FROM celo.transactions t CROSS JOIN ranges rWHERE t.block_date BETWEEN r.date_from AND r.date_to GROUP BY 1UNION ALLSELECT block_date, 'fantom', COUNT(*) FROM fantom.transactions t CROSS JOIN ranges rWHERE t.block_date BETWEEN r.date_from AND r.date_to GROUP BY 1UNION ALLSELECT block_date, 'gnosis', COUNT(*) FROM gnosis.transactions t CROSS JOIN ranges rWHERE t.block_date BETWEEN r.date_from AND r.date_to GROUP BY 1UNION ALLSELECT block_date, 'arbitrum', COUNT(*) FROM arbitrum.transactions t CROSS JOIN ranges rWHERE t.block_date BETWEEN r.date_from AND r.date_to GROUP BY 1UNION ALLSELECT block_date, 'optimism', COUNT(*) FROM optimism.transactions t CROSS JOIN ranges rWHERE t.block_date BETWEEN r.date_from AND r.date_to GROUP BY 1UNION ALLSELECT block_date, 'mantle', COUNT(*) FROM mantle.transactions t CROSS JOIN ranges rWHERE t.block_date BETWEEN r.date_from AND r.date_to GROUP BY 1UNION ALLSELECT block_date, 'base', COUNT(*) FROM base.transactions t CROSS JOIN ranges rWHERE t.block_date BETWEEN r.date_from AND r.date_to GROUP BY 1UNION ALLSELECT block_date, 'zksync', COUNT(*) FROM zksync.transactions t CROSS JOIN ranges rWHERE t.block_date BETWEEN r.date_from AND r.date_to GROUP BY 1UNION ALLSELECT block_date, 'linea', COUNT(*) FROM linea.transactions t CROSS JOIN ranges rWHERE t.block_date BETWEEN r.date_from AND r.date_to GROUP BY 1UNION ALLSELECT block_date, 'scroll', COUNT(*) FROM scroll.transactions t CROSS JOIN ranges rWHERE t.block_date BETWEEN r.date_from AND r.date_to GROUP BY 1UNION ALLSELECT block_date, 'nova', COUNT(*) FROM nova.transactions t CROSS JOIN ranges rWHERE t.block_date BETWEEN r.date_from AND r.date_to GROUP BY 1