1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-11-02 06:13:16 +03:00

chore(udf): rename mcsgetplan.

This commit is contained in:
drrtuy
2025-09-11 11:45:48 +00:00
parent 2506d3fe1e
commit 3f88085360
6 changed files with 15 additions and 15 deletions

View File

@@ -930,8 +930,8 @@ extern "C"
// 0 or 'original' -> pre-RBO plan
// 1 or 'optimized' -> post-RBO plan
// 2 or 'rules' -> comma-separated applied RBO rules
const char* mcsgetplan(UDF_INIT* /*initid*/, UDF_ARGS* args, char* /*result*/, unsigned long* length,
char* is_null, char* /*error*/)
const char* mcs_get_plan(UDF_INIT* /*initid*/, UDF_ARGS* args, char* /*result*/, unsigned long* length,
char* is_null, char* /*error*/)
{
if (get_fe_conn_info_ptr() == NULL)
{
@@ -985,7 +985,7 @@ extern "C"
return out->c_str();
}
my_bool mcsgetplan_init(UDF_INIT* initid, UDF_ARGS* args, char* message)
my_bool mcs_get_plan_init(UDF_INIT* initid, UDF_ARGS* args, char* message)
{
if (args->arg_count > 1)
{
@@ -1002,7 +1002,7 @@ extern "C"
return 0;
}
void mcsgetplan_deinit(UDF_INIT* /*initid*/)
void mcs_get_plan_deinit(UDF_INIT* /*initid*/)
{
}

View File

@@ -80,7 +80,7 @@ CREATE OR REPLACE FUNCTION calenablepartitionsbyvalue RETURNS STRING SONAME 'ha_
CREATE OR REPLACE FUNCTION calshowpartitionsbyvalue RETURNS STRING SONAME 'ha_columnstore.so';
CREATE OR REPLACE AGGREGATE FUNCTION moda RETURNS STRING SONAME 'libregr_mysql.so';
CREATE OR REPLACE FUNCTION mcs_set_ddldebug_level RETURNS STRING SONAME 'ha_columnstore.so';
CREATE OR REPLACE FUNCTION mcsgetplan RETURNS STRING SONAME 'ha_columnstore.so';
CREATE OR REPLACE FUNCTION mcs_get_plan RETURNS STRING SONAME 'ha_columnstore.so';
CREATE DATABASE IF NOT EXISTS infinidb_querystats;
CREATE TABLE IF NOT EXISTS infinidb_querystats.querystats

View File

@@ -22,9 +22,9 @@ SET @@columnstore_ces_optimization_parallel_factor=5;
SELECT SUM(col1) FROM Ti;
SUM(col1)
5050
SET @orig_plan := mcsgetplan('original');
SET @opt_plan := mcsgetplan('optimized');
SET @rbo_rules := mcsgetplan('rules');
SET @orig_plan := mcs_get_plan('original');
SET @opt_plan := mcs_get_plan('optimized');
SET @rbo_rules := mcs_get_plan('rules');
SET @uu_tail := SUBSTRING_INDEX(@orig_plan, '--- Union Unit ---', -1);
SET @unit_open := CONCAT(CHAR(10),' {',CHAR(10));
SELECT (CHAR_LENGTH(@uu_tail) - CHAR_LENGTH(REPLACE(@uu_tail, @unit_open, '')))/CHAR_LENGTH(@unit_open) AS unions_original;
@@ -41,7 +41,7 @@ SET @@columnstore_ces_optimization_parallel_factor=15;
SELECT SUM(col1) FROM Ti;
SUM(col1)
5050
SET @opt_plan := mcsgetplan('optimized');
SET @opt_plan := mcs_get_plan('optimized');
SET @uu_tail := SUBSTRING_INDEX(@opt_plan, '--- Union Unit ---', -1);
SELECT (CHAR_LENGTH(@uu_tail) - CHAR_LENGTH(REPLACE(@uu_tail, @unit_open, '')))/CHAR_LENGTH(@unit_open) AS unions_optimized_15;
unions_optimized_15

View File

@@ -38,9 +38,9 @@ SET @@columnstore_ces_optimization_parallel_factor=5;
SELECT SUM(col1) FROM Ti;
# Snapshot plans into variables for readability
SET @orig_plan := mcsgetplan('original');
SET @opt_plan := mcsgetplan('optimized');
SET @rbo_rules := mcsgetplan('rules');
SET @orig_plan := mcs_get_plan('original');
SET @opt_plan := mcs_get_plan('optimized');
SET @rbo_rules := mcs_get_plan('rules');
# Validate plan contents using stored plans
# Count Union Units by looking for opening unit blocks after the marker '--- Union Unit ---'
@@ -60,7 +60,7 @@ SET @@columnstore_ces_optimization_parallel_factor=15;
# Re-execute to rebuild plan with new factor
SELECT SUM(col1) FROM Ti;
SET @opt_plan := mcsgetplan('optimized');
SET @opt_plan := mcs_get_plan('optimized');
SET @uu_tail := SUBSTRING_INDEX(@opt_plan, '--- Union Unit ---', -1);
SELECT (CHAR_LENGTH(@uu_tail) - CHAR_LENGTH(REPLACE(@uu_tail, @unit_open, '')))/CHAR_LENGTH(@unit_open) AS unions_optimized_15;

View File

@@ -60,5 +60,5 @@ DROP FUNCTION calenablepartitionsbyvalue;
DROP FUNCTION calshowpartitionsbyvalue;
DROP FUNCTION moda;
DROP FUNCTION mcs_set_ddldebug_level;
DROP FUNCTION mcsgetplan;
DROP FUNCTION mcs_get_plan;
--enable_query_log

View File

@@ -60,6 +60,6 @@ CREATE OR REPLACE FUNCTION calenablepartitionsbyvalue RETURNS STRING SONAME 'ha_
CREATE OR REPLACE FUNCTION calshowpartitionsbyvalue RETURNS STRING SONAME 'ha_columnstore.so';
CREATE OR REPLACE AGGREGATE FUNCTION moda RETURNS STRING SONAME 'libregr_mysql.so';
CREATE OR REPLACE FUNCTION mcs_set_ddldebug_level RETURNS STRING SONAME 'ha_columnstore.so';
CREATE OR REPLACE FUNCTION mcsgetplan RETURNS STRING SONAME 'ha_columnstore.so';
CREATE OR REPLACE FUNCTION mcs_get_plan RETURNS STRING SONAME 'ha_columnstore.so';
--enable_query_log