This topic describes the billing details of Hologres Shared Cluster (Lakehouse Acceleration Edition) instances.
Billing method
Hologres Shared Cluster (Lakehouse Acceleration Edition) works in serverless mode and helps accelerate queries on data in MaxCompute data warehouses and data in Object Storage Service (OSS) data lakes. It also supports federated queries on data in MaxCompute and OSS. The billing method of Hologres Shared Cluster (Lakehouse Acceleration Edition) is the same as that of Hologres Shared Cluster (BI-based MaxCompute Acceleration Edition). Each time you run an SQL query job, Hologres calculates the fees based on the amount of input data of the job.
The fees are calculated by using the following formula:
Fees for a query job = Amount of input data × Unit price
Hologres Shared Cluster (Lakehouse Acceleration Edition) uses exclusive computing resources.
Hologres Shared Cluster (Lakehouse Acceleration Edition) charges you based on the amount of data scanned per query job. The minimum billable amount of data scanned per query job is 10 MB even if the amount of data scanned in a query job does not reach 10 MB due to a query startup overhead.
The system sends you a bill on an hourly basis. Each bill records the fees that were generated two hours ago.
No fee is generated if no query is performed.
When you query data from a partitioned table, you can configure filters to specify the partitions from which you want to query data. This helps reduce the amount of scanned data and improve query performance.
You can reduce the amount of data scanned to reduce query costs by reducing the number of query fields and adding filter conditions.
You can convert MaxCompute tables into hash-clustered tables. Hash-clustered tables can help optimize bucket pruning, aggregation, and storage. For more information about hash-clustered tables, see Hash clustering.
Pricing
From March 8, 2023 to April 1, 2025, Hologres Shared Cluster (Lakehouse Acceleration Edition) offers a discount of 50%.
The following table provides the pricing information.
Billing method | Region | Original unit price | Promotional unit price | Unit |
Pay-as-you-go based on the amount of data scanned per SQL query job | China (Beijing) | 0.066705 | 0.0333525 | USD/GB |
China (Shanghai) | 0.066705 | 0.0333525 | USD/GB | |
China (Hangzhou) | 0.066705 | 0.0333525 | USD/GB | |
China (Shenzhen) | 0.066705 | 0.0333525 | USD/GB | |
Singapore | 0.084049 | 0.0420245 | USD/GB |
Lifecycle management
Hologres Shared Cluster (Lakehouse Acceleration Edition) uses the pay-as-you-go billing method based on the amount of data scanned by using SQL statements. The lifecycle management of a pay-as-you-go Hologres Shared Cluster (Lakehouse Acceleration Edition) instance complies with the following rules:
After you purchase a Hologres Shared Cluster (Lakehouse Acceleration Edition) instance on the international site (alibabacloud.com), you can use the instance. The system summarizes the total amount of data scanned by all SQL statements in the previous day and sends you bills. The system automatically deducts the amount payable from the balance of your Alibaba Cloud account.
If your Alibaba Cloud account has overdue payments, all instances that belong to your Alibaba Cloud account become overdue. The instances run normally if the overdue payment is less than USD 1,000.
If the overdue payment in your account reaches USD 1,000 and the deduction fails, the instances run normally within 14 days.
On the fifteenth day after the deduction fails, the instances stop providing services and are locked. You cannot access the instances. During this period, the system does not send you bills.
On the fifteenth day after the instances stop providing services due to an overdue payment, the instances are released and deleted from the console. Data in the instances is also deleted and cannot be restored.
Query the information about SQL queries
You can view the query details of all users as a superuser. RAM users can view information about SQL statements that they run. Sample statement:
select usename,status,query_id,command_tag,duration,query,read_bytes,application_name FROM hologres.hg_query_log;
For more information about SQL queries, see Manage queries.
Query the amount of scanned data
Description
You must have specific permissions to query the amount of scanned data. This section describes the permission rules and authorization methods.
Query the amount of data scanned for all databases in an instance.
Grant the superuser permissions to a user.
A superuser can view the amount of data scanned for all databases in an instance. Execute the following statement to assign the superuser role to a user:
-- Replace Account ID with your Alibaba Cloud account ID. If the user is a RAM user, prefix the account ID with p4_. ALTER USER "Account ID" SUPERUSER;
Add another user to the pg_read_all_stats user group.
In addition to superusers, users in the pg_read_all_stats user group have permissions to query the amount of data scanned for all databases in the relevant Hologres instance. If you are a superuser, you can add regular users to this user group. To add a user to this user group, execute one of the following statements:
GRANT pg_read_all_stats TO "Account ID";-- Use the standard PostgreSQL authorization model to grant related permissions to the user. CALL spm_grant('pg_read_all_stats', 'Account ID'); -- Use the simple permission model (SPM) to grant related permissions to the user. CALL slpm_grant('pg_read_all_stats', 'Account ID'); -- Use the schema-level permission model (SLPM) to grant related permissions to the user.
View the amount of data scanned for the specified database.
Users in the db_admin user group have permissions to query the amount of data scanned for the specified database in the relevant Hologres instance. If you are a superuser, you can add regular users to this user group by using the SPM or SLPM.
CALL spm_grant('<db_name>_admin', 'Account ID'); -- Use the SPM to grant related permissions to the user. CALL slpm_grant('<db_name>.admin', 'Account ID'); -- Use the SLPM to grant related permissions to the user.
Regular users have permissions to query the amount of data scanned by themselves for the database within the relevant Alibaba Cloud account.
For more information about permissions, see Permission management overview.
Query the amount of scanned data over a period of time
You can execute the following SQL statement to check detailed data. Make sure that the user who executes the SQL statement is assigned the superuser role of the Hologres Shared Cluster (BI-based MaxCompute Acceleration Edition) instance.
If the log_min_duration_statement
parameter is set for the instance, you can only query details of bills that are generated based on the amount of scanned data by using SQL statements. The execution time of the statements is greater than or equal to the value specified by the log_min_duration_statement
parameter. For more information about the log_min_duration_statement
parameter, see the configuration items described in Query and analyze slow query logs. Execute the following statement to view the setting of the log_min_duration_statement
parameter.
show log_min_duration_statement;
Syntax
select to_char(query_end,'DD Mon YYYY') as day ,round( sum( case when read_bytes < 10*1024*1024 then 10*1024*1024 else read_bytes end )/1024/1024 ) as "scan_size_mb" -- Scan at least 10 MB of data per query job. ,count(*) as "sql_count" from hologres.hg_query_log where status = 'SUCCESS' and command_tag in ('SELECT') and read_bytes is not null and query_end >= 'Start time'::TIMESTAMPTZ and query_end < 'End time'::TIMESTAMPTZ group by 1 order by 3 desc;
Example
Execute the following SQL statement to query the amount of scanned data from 10:00 on January 1, 2022 to 11:00 on January 1, 2022:
select to_char(query_end,'DD Mon YYYY') as day ,round( sum( case when read_bytes < 10*1024*1024 then 10*1024*1024 else read_bytes end )/1024/1024 ) as "scan_size_mb" -- Scan at least 10 MB of data per query job. ,count(*) as "sql_count" from hologres.hg_query_log where status = 'SUCCESS' and command_tag in ('SELECT') and read_bytes is not null and query_end >= '2022-01-01 10:00:00+08'::TIMESTAMPTZ and query_end < '2022-01-01 11:00:00+08'::TIMESTAMPTZ group by 1 order by 3 desc;
Query the amount of data scanned by each SQL statement over a period of time
You can execute the following SQL statement to query the amount of data scanned by using each SQL statement over a period of time. Make sure that the user who executes the SQL statement is assigned the superuser role of the Hologres Shared Cluster (BI-based MaxCompute Acceleration Edition) instance.
Syntax
select usename ,status ,query_id ,datname ,command_tag ,duration ,message ,query_start ,query_end ,query_date ,query ,case when read_bytes < 10*1024*1024 then 10*1024*1024 else read_bytes end as billing_read_bytes -- Scan at least 10 MB of data by using each SQL statement. ,application_name from hologres.hg_query_log where status = 'SUCCESS' and command_tag in ('SELECT') and read_bytes is not null and query_end >= 'Start time'::TIMESTAMPTZ and query_end < 'End time'::TIMESTAMPTZ
The billing_read_bytes field indicates the amount of scanned data used for billing.
Example
Execute the following SQL statement to query the amount of data scanned by using each SQL statement from 10:00 on March 1, 2022 to 11:00 on March 1, 2022:
select usename ,status ,query_id ,datname ,command_tag ,duration ,message ,query_start ,query_end ,query_date ,query ,case when read_bytes < 10*1024*1024 then 10*1024*1024 else read_bytes end as billing_read_bytes -- Scan at least 10 MB of data by using each SQL statment. ,application_name from hologres.hg_query_log where status = 'SUCCESS' and command_tag in ('SELECT') and read_bytes is not null and query_end >= '2022-03-01 10:00:00+08'::TIMESTAMPTZ and query_end < '2022-03-01 11:00:00+08'::TIMESTAMPTZ;