MaxCompute charges for compute resources after a job completes successfully. Fees are calculated per job type, aggregated daily, and deducted from your account balance before 06:00 the next day.
Two billing methods are available:
-
Pay-as-you-go (post-paid): Charges apply only for resources consumed after each job finishes. Supported job types: SQL, MapReduce, Spark, Mars, MaxCompute Query Acceleration (MCQA), and MaxFrame.
-
Subscription (pre-paid): Purchase a fixed amount of computing resources in advance. MapReduce, Spark, Mars, and MaxFrame jobs run within your purchased quota at no extra charge.
If your account has an overdue payment, your service may be suspended. Renew your subscription promptly to avoid interruptions.
Billing at a glance
| Job type | Billing basis | Unit price |
|---|---|---|
| Standard SQL | Input data scanned × SQL complexity | USD 0.0438/GB |
| SQL (external tables) | Input data scanned | USD 0.0044/GB |
| MapReduce | Billable hours (cores × runtime) | USD 0.0690/billable hour |
| Spark | Billable hours (MAX of CPU-based or memory-based) | USD 0.1041/billable hour |
| Mars | Billable hours (MAX of CPU-based or memory-based) | USD 0.1041/billable hour |
| MaxFrame (Standard Edition) | Billable hours (CU-hours) | USD 0.0541/billable hour |
| MCQA | Input data scanned × SQL complexity | USD 0.0438/GB |
The SAU (Riyadh - Partner Region) is operated by a partner and has different unit prices. See the per-job-type sections below for details.
What's not billed
| Scenario | Details |
|---|---|
| Failed jobs | SQL, MapReduce, Spark, and Mars jobs that fail are not charged. |
| Queue time | Time a MapReduce, Spark, or Mars job spends waiting in the queue is not billed. |
| Canceled MCQA jobs | Canceled query acceleration jobs are not charged. |
| Idle time | No charge when no jobs are running. |
| Non-billed job types | Graph and machine learning jobs are free of charge. |
| UDF-only SQL jobs | SQL jobs that run only user-defined functions (UDFs) are not charged. |
| Within subscription quota | If you have a MaxCompute subscription, MapReduce, Spark, Mars, and MaxFrame jobs within your purchased quota incur no additional charge. |
Subscription
One Compute Unit (CU) consists of 4 GB of memory and 1 CPU core.
| Resource | Memory | CPU | Price |
|---|---|---|---|
| 1 CU | 4 GB | 1 CPU core | USD 22.0/month |
Use Resource Monitoring to monitor and manage your subscription resources.
Start with pay-as-you-go if you are a new user. Subscription is more cost-effective when your resource consumption is predictable and consistently high.
Standard SQL jobs
How billing works
Fee = Input data scanned (GB) × SQL complexity × USD 0.0438
Input data scanned is the compressed data size that the SQL job actually reads—not the full table size. Two optimizations reduce this:
-
Partition filtering: If your query contains
WHERE ds > 20130101anddsis a partition key, only the data in matching partitions is billed. -
Column pruning:
SELECT f1, f2, f3 FROM t1bills only columnsf1,f2, andf3—not the entire table.
SQL complexity is based on the number of SQL keywords in the statement:
| Number of SQL keywords | Complexity factor |
|---|---|
| ≤ 3 | 1 |
| 4–6 | 1.5 |
| 7–19 | 2 |
| ≥ 20 | 4 |
The keyword count formula is:
Keywords = JOINs + GROUP BYs + ORDER BYs + DISTINCTs + window functions
+ MAX(INSERTs | UPDATEs | DELETEs − 1, 1)
To estimate cost before running a query, use the COST SQL command:
COST SQL <your SQL statement>;
Unit price
| Region | Price |
|---|---|
| Standard regions | USD 0.0438/GB |
| SAU (Riyadh - Partner Region) | USD 0.05256/GB |
Calculation examples
Example 1: A query with DISTINCT, GROUP BY, and ORDER BY
odps@ $odps_project >COST SQL SELECT DISTINCT total1 FROM
(SELECT id1, COUNT(f1) AS total1 FROM in1 GROUP BY id1) tmp1
ORDER BY total1 DESC LIMIT 100;
Input: 1825361100.8 Bytes
Complexity: 1.5
This query has 4 keywords (1 DISTINCT + 1 GROUP BY + 1 ORDER BY + MAX(0−1, 1) = 1), giving a complexity of 1.5. With ~1.7 GB of input data:
Cost = 1.7 GB × 1.5 × USD 0.0438 = USD 0.11
Example 2: Effect of column pruning on cost
Suppose a table has 20 columns and is 40 GB compressed. A full-table scan bills the entire 40 GB. If your query reads only 3 of those 20 columns (~6 GB of compressed data), the cost drops proportionally:
| Query | Data scanned | Cost |
|---|---|---|
| Full table scan | 40 GB | 40 × 1 × USD 0.0438 = USD 1.75 |
| 3-column query | 6 GB | 6 × 1 × USD 0.0438 = USD 0.26 |
Selecting only the columns you need can reduce SQL costs significantly.
SQL jobs that query external tables
Since March 2019, SQL jobs that reference external tables are billed separately from internal table queries.
How billing works
Fee = Input data volume (GB) × USD 0.0044
Key differences from standard SQL billing:
-
SQL complexity is always 1 (not calculated).
-
When a query joins both internal and external tables, each part is billed at its respective rate.
-
You cannot estimate fees for external table queries before running them.
Unit price
| Region | Price |
|---|---|
| Standard regions | USD 0.0044/GB |
| SAU (Riyadh - Partner Region) | USD 0.00528/GB |
MapReduce jobs
Pay-as-you-go billing for MapReduce jobs started on December 19, 2017.
How billing works
Daily fee = Total billable hours × USD 0.0690
Billable hours for a single job:
Billable hours = Job runtime (hours) × Number of CPU cores used
For example, a job using 100 cores for 30 minutes: 100 × 0.5 = 50 billable hours.
Unit price
| Region | Price |
|---|---|
| Standard regions | USD 0.0690/billable hour |
| SAU (Riyadh - Partner Region) | USD 0.0828/billable hour |
Spark jobs
Pay-as-you-go billing for Spark jobs started on February 1, 2019. For more information, see MaxCompute Spark.
How billing works
Daily fee = Total billable hours × USD 0.1041
Billable hours take the larger of the CPU-based and memory-based calculations:
Billable hours = MAX(CPU cores × runtime hours, CEILING(Memory GB × runtime hours / 4))
This ensures you are billed for whichever resource—CPU or memory—your job uses more of.
Examples:
| CPU cores | Memory | Runtime | CPU-based | Memory-based | Billable hours |
|---|---|---|---|---|---|
| 2 | 5 GB | 1 hour | 2 × 1 = 2 | ⌈5 × 1 / 4⌉ = 2 | 2 |
| 2 | 10 GB | 1 hour | 2 × 1 = 2 | ⌈10 × 1 / 4⌉ = 3 | 3 |
In the second example, memory drives the cost despite the same number of CPU cores.
Unit price
| Region | Price |
|---|---|
| Standard regions | USD 0.1041/billable hour |
| SAU (Riyadh - Partner Region) | USD 0.12492/billable hour |
Mars jobs
Pay-as-you-go billing for Mars jobs started on September 1, 2020. For more information, see Data science (Mars).
How billing works
Mars jobs use the same billing formula as Spark jobs:
Daily fee = Total billable hours × USD 0.1041Billable hours = MAX(CPU cores × runtime hours, CEILING(Memory GB × runtime hours / 4))
Examples:
| CPU cores | Memory | Runtime | Billable hours |
|---|---|---|---|
| 2 | 5 GB | 1 hour | 2 |
| 2 | 10 GB | 1 hour | 3 |
Unit price
| Region | Price |
|---|---|
| Standard regions | USD 0.1041/billable hour |
| SAU (Riyadh - Partner Region) | USD 0.12492/billable hour |
MCQA jobs
Pay-as-you-go billing for MCQA jobs started on October 1, 2020. For more information, see Query acceleration (MCQA).
Pay-as-you-go billing for MCQA is available in China (Hong Kong), Singapore, Indonesia (Jakarta), and Malaysia (Kuala Lumpur). This feature is in public preview. Other regions will be added later.
How billing works
Fee = Input data scanned (GB) × SQL complexity × USD 0.0438
MCQA uses columnar storage with data compression. Charges are based on compressed data size.
If you have purchased subscription resources and allocated a portion to MCQA, jobs running within that quota are not billed additionally. If you use only pay-as-you-go, MCQA jobs are billed the same way as standard SQL jobs.
Partition filtering reduces the amount of scanned data and lowers costs, the same way it works for standard SQL jobs.
Unit price
| Region | Price |
|---|---|
| Standard regions | USD 0.0438/GB |
| SAU (Riyadh - Partner Region) | USD 0.05256/GB |
MaxFrame jobs
How billing works
Daily fee = Total billable hours (CU-hours) × USD 0.0541
Pay-as-you-go billing for MaxFrame is available in: China (Hangzhou), China (Shanghai), China (Beijing), China (Ulanqab), China (Shenzhen), China (Chengdu), China (Hong Kong), Japan (Tokyo), Singapore, Indonesia (Jakarta), Germany (Frankfurt), US (Silicon Valley), US (Virginia), and China East 1 Finance Cloud.
Unit price
Standard MaxFrame jobs (using the pay-as-you-go Standard Edition computing quota):
| Region | Price |
|---|---|
| Standard regions | USD 0.0541/billable hour |
| SAU (Riyadh - Partner Region) | USD 0.06496/billable hour |
What's next
-
Analyze your MaxCompute bills to understand cost distribution and identify savings opportunities: Analyze MaxCompute billing usage records
-
Investigate sudden cost spikes to find which projects or jobs are driving unexpected charges: Troubleshoot sudden spikes in MaxCompute pay-as-you-go costs