Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

table size reduction disproportionate after row deletions #137914

Open
Jon-ltr opened this issue Dec 23, 2024 · 3 comments
Open

table size reduction disproportionate after row deletions #137914

Jon-ltr opened this issue Dec 23, 2024 · 3 comments
Labels
A-storage Relating to our storage engine (Pebble) on-disk storage. C-bug Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior. O-community Originated from the community T-storage Storage Team X-blathers-triaged blathers was able to find an owner

Comments

@Jon-ltr
Copy link

Jon-ltr commented Dec 23, 2024

I recently deleted a significant number of rows from a table (approximately 24x fewer rows), but the size of the table on disk only decreased by about 9x. This disparity seems unusual, and I’m wondering if there’s something about internal storage or garbage collection I might be missing.

I already tried making the GC run more frequently by running these commands:

ALTER RANGE default CONFIGURE ZONE USING gc.ttlseconds=600; ALTER DATABASE system CONFIGURE ZONE USING gc.ttlseconds=600;

Is there a known reason why the size reduction isn’t proportional to the row reduction?

Environment:

  • CockroachDB version 21.2.17
  • Server OS: Ubuntu, running cockroach in docker

Jira issue: CRDB-45808

@Jon-ltr Jon-ltr added the C-bug Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior. label Dec 23, 2024
Copy link

blathers-crl bot commented Dec 23, 2024

Hi @Jon-ltr, please add branch-* labels to identify which branch(es) this C-bug affects.

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

Copy link

blathers-crl bot commented Dec 23, 2024

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

It looks like you have not filled out the issue in the format of any of our templates. To best assist you, we advise you to use one of these templates.

I have CC'd a few people who may be able to assist you:

  • @cockroachdb/sql-foundations (found keywords: ALTER DATABASE)

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

  • Join our community slack channel and ask on #cockroachdb.
  • Try find someone from here if you know they worked closely on the area and CC them.

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

@blathers-crl blathers-crl bot added O-community Originated from the community X-blathers-triaged blathers was able to find an owner labels Dec 23, 2024
@jeffswenson jeffswenson added the T-storage Storage Team label Dec 23, 2024
@blathers-crl blathers-crl bot added the A-storage Relating to our storage engine (Pebble) on-disk storage. label Dec 23, 2024
@jeffswenson
Copy link
Collaborator

jeffswenson commented Dec 23, 2024

If the table you are cleaning up is a relatively small part of the database, it could be the storage is used by uncompacted levels inside of the pebble LSM. If this is the case, I would expect a large drop in table live bytes immediately following the deletion and the storage used by the table to drop over time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-storage Relating to our storage engine (Pebble) on-disk storage. C-bug Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior. O-community Originated from the community T-storage Storage Team X-blathers-triaged blathers was able to find an owner
Projects
Status: Incoming
Development

No branches or pull requests

2 participants