-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Open
Labels
A-sql-table-statsTable statistics (and their automatic refresh).Table statistics (and their automatic refresh).C-bugCode not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.E-quick-winLikely to be a quick win for someone experienced.Likely to be a quick win for someone experienced.O-communityOriginated from the communityOriginated from the communityT-sql-queriesSQL Queries TeamSQL Queries Team
Description
Describe the problem
I joined three tables into a materialized view in my database, but I am not observing any auto-statistic creation jobs running on the view, nor am I able to manual create the statistics, instead receiving the following error:
root@test-db:26257/test> analyze test_view_v0_0;
ERROR: "test_view_v0_0" is not a table
SQLSTATE: 42809
To Reproduce
- Create two tables
- Create view from both tables, no functions used, just denormalizing the data
- Create a few non-covering indexes on the view also.
- Observe that stats are not created, nor can you manually run
AnalyzeorCREATE STATISTICS
Expected behavior
I would expect to be able to generate statistics on a materialized view and it's indices.
Environment:
- CockroachDB version 21.2.5
Additional context
Attempting to optimize queries on an extremely large dataset are not using the intended indexes due to lack of statistics
Jira issue: CRDB-14007
Epic: CRDB-13625
beatty, alex-berger, trourance, 3nassale7, zhangm365 and 2 more
Metadata
Metadata
Assignees
Labels
A-sql-table-statsTable statistics (and their automatic refresh).Table statistics (and their automatic refresh).C-bugCode not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.E-quick-winLikely to be a quick win for someone experienced.Likely to be a quick win for someone experienced.O-communityOriginated from the communityOriginated from the communityT-sql-queriesSQL Queries TeamSQL Queries Team
Type
Projects
Status
Backlog