cockroachdb / cockroach

CockroachDB — the cloud native, distributed SQL database designed for high availability, effortless scale, and control over data placement.
https://www.cockroachlabs.com
Other
29.85k stars 3.77k forks source link

Got "Drop unused index" recommendation on sequence #119624

Open ZsBT opened 6 months ago

ZsBT commented 6 months ago

Describe the problem

I got an index recommendation "Drop unused index". Reason: This index has not been used and can be removed for better write performance.

But, that is not an index of a table, but a sequence.

CC thinks the index was created like this: CREATE INDEX "primary" ON defaultdb.public.nextid USING btree (value ASC)

But the actual creation statement was:

CREATE SEQUENCE nextid start with 1001 INCREMENT BY 7;

To Reproduce

A sequence was created as written above.

Expected behavior

Not to recommend index deletion on non-existent indicies

Additional data / screenshots

Screenshot from 2024-02-25 16-03-55

Environment:

Container in docker swarm

# cockroach version
Build Tag:        v23.2.1
Build Time:       2024/02/15 22:46:26
Distribution:     CCL
Platform:         linux amd64 (x86_64-pc-linux-gnu)
Go Version:       go1.21.5 X:nocoverageredesign
C Compiler:       gcc 6.5.0
Build Commit ID:  898cd6a363fd47bb92a03bac216f9bed0f64bc08
Build Type:       release
Enabled Assertions: false

Additional context No impact

Jira issue: CRDB-36244

blathers-crl[bot] commented 6 months ago

Hello, I am Blathers. I am here to help you get the issue triaged.

Hoot - a bug! Though bugs are the bane of my existence, rest assured the wretched thing will get the best of care here.

I was unable to automatically find someone to ping.

If we have not gotten back to your issue within a few business days, you can try the following:

:owl: Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf.

DrewKimball commented 6 months ago

+cc @xinhaoz Does this seem related to #119789?

inpos commented 4 months ago

Hi. I have same issue in V23.2.4

schema

details

drop_failed