StarRocks Documentation

website·Indexed 32 days ago

https://docs.phoenixdata.ai/Cloud/release_notes/

Technical documentation for StarRocks, featuring a comprehensive SQL reference for version 26.2 Preview. Includes guides on SQL statements for account management, table design (such as Primary Key tables), data loading and unloading (Routine Load, Spark Load), materialized views, and cluster management. Also provides details on the custom resource (CRD) API and Trino SQL statement translation available from v3.3.9.

Tokens
6.5M
Snippets
28.3K
Records
43.5K
Agent score
51%

What's inside StarRocks

  1. Overview of StarRocks Query Cache

    The StarRocks query cache enhances the performance of aggregate queries by storing intermediate results of local aggregations in memory. This avoids redundant disk access and computation for identical or similar queries, making it particularly effective for high-concurrency scenarios involving large, complex datasets.

    Support Matrix:

    • Shared-nothing clusters: Supported since v2.5
    • Shared-data clusters: Supported since v3.4.0
    • Single flat tables: Supported since v2.5
    • Star schema (multiple joined tables): Supported since v3.0
  2. Overview of PhoenixAI Cloud Service Accounts

    Service accounts are independent identities used to facilitate access control for the PhoenixAI Cloud API and the PhoenixAI Cloud Terraform provider. Unlike application keys, service accounts do not depend on specific PhoenixAI members, meaning their access remains intact even if the member who created them is removed.

    Constraints:

    • Only members with the Member Management privilege can create service accounts and grant privileges.
    • Service accounts cannot be used to log in to the PhoenixAI Cloud console; they are strictly for API and Terraform provider access.
  3. Overview of cluster suspension and cost savings

    PhoenixAI allows suspending clusters to avoid unnecessary costs during idle time. When a cluster is suspended, PhoenixAI stops charging CCUs for that cluster, and the user no longer pays the cloud provider for the underlying virtual machines. Suspending a cluster automatically suspends all associated warehouses, including the default warehouse.
  4. Overview of HyperLogLog (HLL) for approximate distinct counting

    HyperLogLog (HLL) is an approximate deduplication algorithm used in StarRocks to reduce computational pressure when dealing with massive datasets. It provides a balance between accuracy and performance, typically maintaining an error rate between 1% and 10% depending on the dataset size and hash function used. It is particularly useful when the cardinality of a dataset is very high and an approximate count is acceptable.
  5. Overview of StarRocks Security Integrations

    Security integrations allow StarRocks to connect with external authentication systems (such as LDAP), eliminating the need to manually create users within StarRocks. When a user attempts to log in with an external ID, StarRocks authenticates them based on the authentication_chain configuration. Upon successful authentication, a virtual user is created for the session.

    Important Constraints:

    • Authorization: To enable external authorization when using security integrations, StarRocks must be integrated with Apache Ranger. Native StarRocks authorization is currently not supported for security integrations.
    • Group Management: To access group information from the external system for user group creation and authorization, the Group Provider must be enabled.
    • Connectivity: StarRocks does not perform a connectivity check during the creation of a security integration.
  6. Overview of BE and CN Blacklisting

    StarRocks allows blacklisting Backend (BE) and Compute Nodes (CN) to avoid frequent query failures caused by connection issues.

    • BE Blacklisting: Supported since v3.3.0.
    • CN Blacklisting: Supported since v4.0.
    • Automatic Management: By default, StarRocks automatically adds nodes to the blacklist when connections are lost and removes them when connections are re-established. However, nodes added manually remain blacklisted until manually removed.
    • Permissions: Only users with SYSTEM-level BLACKLIST permissions can use these features.
    • Scope: Each Frontend (FE) node maintains its own independent BE and CN blacklist; they are not shared across FE nodes.
  7. Overview of Spark Load in StarRocks

    Spark Load is an asynchronous import method used to preprocess data imported via external Spark resources. It is primarily designed for initial migrations or importing massive datasets into StarRocks to improve performance and save cluster computing resources. Users create import tasks via the MySQL protocol and monitor results using the SHOW LOAD command.

    Constraints:

    • The user must have INSERT permissions on the target StarRocks table.
    • Bucket columns in the target StarRocks table must NOT be of type DATE, DATETIME, or DECIMAL when using Spark Load.
  8. Overview of Query Queue v2

    Introduced in v3.3, Query Queue v2 replaces fixed thresholds (concurrency, memory, CPU) with a logical slot-based system. It estimates the BE resources required by each query and schedules them based on available slots.

    In shared-nothing clusters, it is enabled via FE configuration (enable_query_queue_v2), which requires an FE restart. In shared-data clusters, it is configured per warehouse.

  9. Overview of AUTO_INCREMENT columns in StarRocks

    The AUTO_INCREMENT column attribute allows StarRocks to automatically assign unique integer IDs to new rows when values are not specified. This is useful for creating primary keys, optimizing join operations (using integers instead of strings like UUIDs), and improving the performance of distinct counts on high-cardinality columns.

    Constraints:

    • The data type of an AUTO_INCREMENT column must be BIGINT.
    • Values start from 1 and increment by 1 for each new row.
  10. Overview of Data Cache Warmup

    Data Cache Warmup is an active process in StarRocks (introduced in v3.3) that proactively fetches desired data from remote storage into the local data cache. This differs from standard Data Cache, which is a passive process where data is cached only during active querying. Warmup is particularly useful for high-performance requirements like BI reports and PoC testing to avoid repeated remote data fetches.

    Prerequisites and Constraints:

    • The Data Cache feature must be enabled before using warmup.
    • Storage Capacity: The cache disk must have significantly more capacity than the data being warmed up; otherwise, newer data will evict previously warmed data.
    • Disk Stability: High volumes of new data writes or unexpected large 'cold' queries during the warmup process can evict warmed data from the cache.
  11. Overview of StarRocks Vector Index Types

    StarRocks supports two types of vector indexing for approximate nearest neighbor search (ANNS) at the Segment file level. Each table supports only one vector index.

    • IVFPQ (Inverted File with Product Quantization): Uses an inverted file to divide data into clusters and product quantization to compress high-dimensional vectors. It offers a high compression ratio (~1:0.15) but requires additional fine ranking, which can increase latency.
    • HNSW (Hierarchical Navigable Small World): A graph-based algorithm that builds a hierarchical structure of navigable small world graphs. It has a lower compression ratio (~1:0.8) but provides precise ranking with lower computation costs and latency, though it requires more storage.
  12. Overview of StarRocks Vector Index Types

    StarRocks supports two types of vector indexes for Approximate Nearest Neighbor Search (ANNS) on shared-nothing clusters (v3.4+). These indexes map search items to row IDs within segment files to enable fast data retrieval without calculating distances for every row.

    • IVFPQ (Inverted File with Product Quantization): Uses an inverted file to partition data into clusters (Voronoi cells) and product quantization to compress high-dimensional vectors. It offers high compression (approx 1:0.15) and allows adjusting memory costs via index block cache ratios, but may require additional re-ranking for final accuracy.
    • HNSW (Hierarchical Navigable Small World): A graph-based algorithm that builds a hierarchical structure of navigable small world graphs. It provides higher accuracy and lower latency without additional processing, but has lower compression (approx 1:0.8) and higher storage costs. It currently only supports full file caching.