Hologres shared cluster (Lakehouse Acceleration) uses a serverless approach to accelerate queries on data in MaxCompute data warehouses and OSS data lakes. It also supports federated analytics across data lakes and warehouses. This service uses the same billing method as the original shared cluster (MaxCompute BI Acceleration). You pay only for queries you run — no charges apply when the instance is idle.
Billing model
The billing formula is:
Cost per query job = Amount of input data scanned × Unit price
Key billing rules:
| Rule | Detail |
|---|---|
| Minimum charge | 10 MB per query. Queries that scan less than 10 MB are billed at 10 MB to account for query startup overhead. |
| Billing cycle | Bills are generated hourly and contain data from the two hours prior. |
| No idle charges | No charges are incurred when no queries are running. |
| Dedicated resources | The shared cluster (Lakehouse Acceleration) uses dedicated computing resources. |
Pricing
Starting March 8, 2023, all queries on shared cluster (Lakehouse Acceleration) instances receive a 50% discount. This offer ends on April 1, 2025.
| Region | Original price | Promotional price | Unit |
|---|---|---|---|
| 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 |
Reduce query costs
Three techniques lower the volume of data scanned and reduce your bill:
-
Apply partition filters: When querying partitioned tables, add partition filter conditions to skip irrelevant partitions.
-
Select fewer columns: Query only the fields you need rather than using
SELECT *. -
Use Hash Clustering tables: Convert MaxCompute tables to Hash Clustering tables to enable bucket pruning, aggregation pushdown, and storage optimization. See Hash Clustering for details.
Query your scan volume
Permissions
Access to scan volume data in hologres.hg_query_log depends on your role:
| Role | Scope |
|---|---|
| Superuser | All DBs in the instance |
| pg_read_all_stats group member | All DBs in the instance |
| db_admin (simple permission model (SPM) or schema-level permission model (SLPM) enabled) | Current DB only |
| Regular user | Own queries in the current DB only |
Grant superuser access
-- Replace "Alibaba Cloud account ID" with the actual username.
-- For a RAM user, add "p4_" before the account ID.
ALTER USER "Alibaba Cloud account ID" SUPERUSER;
Grant pg_read_all_stats access
GRANT pg_read_all_stats TO "Alibaba Cloud account ID"; -- Standard PostgreSQL authorization model
CALL spm_grant('pg_read_all_stats', 'Alibaba Cloud account ID'); -- SPM
CALL slpm_grant('pg_read_all_stats', 'Alibaba Cloud account ID'); -- SLPM
Grant db_admin access (current DB only)
CALL spm_grant('<db_name>_admin', 'Alibaba Cloud account ID'); -- SPM
CALL slpm_grant('<db_name>.admin', 'Alibaba Cloud account ID'); -- SLPM
For a full overview of permission management, see Permission management overview.
If log_min_duration_statement is set for the instance, hg_query_log only records SQL statements whose execution time meets or exceeds that threshold. Billing details for faster queries will not appear. To check the current threshold:
SHOW log_min_duration_statement;
Query aggregated scan volume by day
Use this query to get daily scan totals for a time range. Requires superuser access.
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, -- 10 MB minimum applied per query
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: Query scan volume from 10:00 to 11:00 on January 1, 2022 (UTC+8)
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,
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 scan volume per SQL statement
Use this query to see billable scan volume for each individual SQL statement over a time range. Requires superuser access.
All examples use billing_read_bytes — the scan volume with the 10 MB minimum applied — as the field used for cost calculation.
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, -- 10 MB minimum applied
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 represents the scanned data volume used for billing.
Example: Query per-statement scan volume from 10:00 to 11:00 on March 1, 2022 (UTC+8)
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,
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;
View query details
A superuser can view query details for all users. A Resource Access Management (RAM) user can view only their own SQL statements.
SELECT usename, status, query_id, command_tag, duration, query, read_bytes, application_name
FROM hologres.hg_query_log;
For more information, see Query management.
Lifecycle management
After you purchase and enable a shared cluster (Lakehouse Acceleration) instance, the system aggregates your previous day's query data, generates a bill, and automatically deducts the fee from your account.
-
After you purchase and enable a Hologres shared cluster (Lakehouse Acceleration) instance from the Alibaba Cloud website, you can start using it. The system then aggregates the data from all SQL queries from the previous day, generates a bill, and automatically deducts the fee from your account.
-
If your Alibaba Cloud account has an overdue payment, all instances under that account enter an Overdue state. If the total overdue amount is less than 1,000 USD, the instance continues to run normally.
-
When the total overdue amount reaches 1,000 USD, the system attempts to deduct the payment. If the deduction fails, the instance continues to run normally for 14 days.
-
On the 15th day after the deduction fails, the service for the instance is suspended. The instance enters a locked state and cannot be accessed. No bills are generated during this period.
-
On the 15th day after the service is suspended, the instance is released. This means the instance is deleted from the console, and all its data is purged and cannot be recovered.
The following table describes what happens when a payment becomes overdue:
| Stage | Condition | Outcome |
|---|---|---|
| Overdue state | Overdue amount < 1,000 USD | Instance continues to run normally |
| Failed deduction | Overdue amount reaches 1,000 USD; deduction fails | Instance runs normally for 14 more days |
| Service suspended | 15th day after failed deduction | Instance enters a locked state; cannot be accessed; no bills generated |
| Instance released | 15th day after service suspended | Instance deleted from the console; all data purged and cannot be recovered |