Hi team - I was planning to create an ANALYZE job ...
# questions-and-troubleshooting
v
Hi team - I was planning to create an ANALYZE job - https://docs.starrocks.io/docs/sql-reference/sql-statements/cbo_stats/SHOW_ANALYZE_JOB/ but as per the docs it seems we already have a job for this.
Copy code
>> SHOW ANALYZE JOB;
[
  {
    "Id": "11001",
    "Catalog": "default_catalog",
    "Database": "ALL",
    "Table": "ALL",
    "Columns": "ALL",
    "Type": "FULL",
    "Schedule": "SCHEDULE",
    "Properties": "{default_job_flag=true}",
    "Status": "FINISH",
    "LastWorkTime": "2025-12-01 14:00:25",
    "Reason": ""
  }
]
Also when I check the ANALYZE job for my db using - `SHOW ANALYZE JOB where
database
= 'my_db';` it returns nothing. I am confused why the default ANALYZE job isn't visible for
my_db
but it says
"Database": "ALL",
. Please guide if I should really have a separate ANALYZE job or the default one will take care of all the DBs, Tables, Columns etc?
@Sida Shen could you please help here?
r
The default takes care of all your tables. But if you think it's not enough, you can create your own depending on your needs. You can choose which tables/column/db you want to collect the statistic of, but you need to set
enable_collect_full_statistic = false
More info here: https://docs.starrocks.io/docs/sql-reference/sql-statements/cbo_stats/CREATE_ANALYZE/
a
Hi @Robert Raharjo Thanks for your response. We have writes happening throughout the day. Our production join / read queries are struggling when analyzed with “SAMPLE” mode of statistics collection. Even after tweaking params (as mentioned in CBO Docs), automated collection task is defaulting to SAMPLE Is there a way we can overwrite this job to ALWAYS do FULL only?
r
Have you tried setting
enable_collect_full_statistic
to false, and drop your old cbo collection, and create a new one e.g.
create analyze full ...
. How did you create your analyze job
a
hey @Robert Raharjo enable_collect_full_statistic is false and I created using
Copy code
CREATE ANALYZE FULL ALL
I also dropped the
default_job_flag
job manually. But I keep seeing a default job being created with SAMPLE type.
r
that's the starrocks managed statistic collection - this sr managed depends on the config. I think you should set
enable_collect_full_statistic
back to true, since your cbo is collecting statistic from all database regardless.