This topic describes other common statements that are used when you use MaxCompute SQL for your business development.

Cost estimation

Estimates the cost of executing an SQL job based on the amount of input data, number of user-defined functions (UDFs), and complexity of the job. If partition pruning is enabled for the UDFs, you cannot estimate the expense in this case because you cannot determine the number of partitions that are scanned.

Note The result is for reference only. You can view your bill for the actual costs.
  • Syntax
    cost sql <sql_sentence>;
  • Parameter

    sql_sentence: the SQL statement for which you want to estimate the execution cost.

  • Example:
    cost sql select * from sale_detail;
    The following result is returned:
    ID = 20150715113033121xxxxxxx
    UDF:0
    Complexity:1.0
    Input:0 Bytes
    Parameter description:
    • UDF: the number of UDFs that are used in an SQL job.
    • Complexity: the complexity of an SQL job. For more information, see SQL complexity.
    • Input: the amount of data scanned in an SQL job.