[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-04 UTC."],[[["\u003cp\u003eThis page features examples of Blockchain Analytics queries specifically designed for the Polygon Mainnet.\u003c/p\u003e\n"],["\u003cp\u003eYou can use BigQuery to find the first and most recent block numbers on the Polygon Mainnet.\u003c/p\u003e\n"],["\u003cp\u003eQueries can be executed in BigQuery to calculate the transactions per second (TPS) on the Polygon Mainnet, grouped by month.\u003c/p\u003e\n"],["\u003cp\u003ePre-built queries are loaded into the BigQuery Editor for ease of use.\u003c/p\u003e\n"]]],[],null,["# Polygon Mainnet example queries\n\nThis page provides Blockchain Analytics query examples for Polygon Mainnet.\n\nSee the [BigQuery documentation](/bigquery/docs/introduction) for\ninstructions on using BigQuery.\n\nView the earliest and most recently indexed block\n-------------------------------------------------\n\nIn the Google Cloud console, go to the **BigQuery** page.\n\n[Go to BigQuery](https://console.cloud.google.com/bigquery?sq=650023896125:5893450501c0464faf9e9c511432353a)\n\nThe following query is loaded into the **Editor** field: \n\n SELECT\n MIN(block_number) AS `First block`,\n MAX(block_number) AS `Newest block`,\n COUNT(1) AS `Total number of blocks`\n FROM\n bigquery-public-data.goog_blockchain_polygon_mainnet_us.blocks;\n\nThe following shows an example result:\n\nCalculate TPS (transactions per second) by month on Polygon mainnet\n-------------------------------------------------------------------\n\n[Go to BigQuery](https://console.cloud.google.com/bigquery?sq=650023896125:c72953cdf4f64699934c8d467de1e718)\n\nThe following query is loaded into the **Editor** field: \n\n SELECT\n COUNT(*) AS TXN_COUNT_PER_MONTH,\n COUNT(*) / 2592000.0 AS TXN_PER_SECOND, # seconds in a month\n EXTRACT(YEAR\n FROM\n txn.block_timestamp) AS YEAR,\n EXTRACT(MONTH\n FROM\n txn.block_timestamp) AS MONTH,\n FROM\n `bigquery-public-data.goog_blockchain_polygon_mainnet_us.transactions` AS txn\n GROUP BY\n EXTRACT(YEAR\n FROM\n txn.block_timestamp),\n EXTRACT(MONTH\n FROM\n txn.block_timestamp)\n ORDER BY TXN_COUNT_PER_MONTH DESC;\n\nThe following shows an example result:"]]