StarRocks / starrocks

The world's fastest open query engine for sub-second analytics both on and off the data lakehouse. With the flexibility to support nearly any scenario, StarRocks provides best-in-class performance for multi-dimensional analytics, real-time analytics, and ad-hoc queries. A Linux Foundation project.
https://starrocks.io
Apache License 2.0
8.98k stars 1.8k forks source link

Provide the ability to support system functions #47950

Open zhangheihei opened 4 months ago

zhangheihei commented 4 months ago

Feature request

Is your feature request related to a problem? Please describe.

Reference to other DBs,provides the following types of system functions:

For example: support dynamic restrict access table for cbo collect statistics

  1. contorl funtion add exclusion
    select system$cbo_stats_add_exclusion("catalog",  "FULL");
    select system$cbo_stats_add_exclusion("catalog.db",  "FULL");
    select system$cbo_stats_add_exclusion("catalog.db.tbl",  "FULL");

remove exclusion

select system$cbo_stats_remove_exclusion(id)
  1. information funsion
    select  system$cbo_stats_show_exclusion()

Design Doc https://docs.google.com/document/d/1ywUfACK-ph67cgIwM9LzMfc7svIScdnKHTAQOFtXW7s/edit

alvin-celerdata commented 4 months ago

@zhangheihei Thank you for adding such exciting features to StarRocks. Except for the function name, could you add more information for these functions, like the return of these functions?

zhangheihei commented 4 months ago

hi @alvin-celerdata I'll add doc, UT and sql test later.

zhangheihei commented 4 months ago

hi @alvin-celerdata the desgin doc added. For review purposes, I've split pr47951 into two parts. 1 System function frame: https://github.com/StarRocks/starrocks/pull/48380 2 Implementation of specific functions such as cbo_stats_add_exclusion