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

db: add method to compute statistics over a key span #1996

Closed
jbowens opened this issue Oct 4, 2022 · 2 comments
Closed

db: add method to compute statistics over a key span #1996

jbowens opened this issue Oct 4, 2022 · 2 comments

Comments

@jbowens
Copy link
Collaborator

jbowens commented Oct 4, 2022

In some issues (eg, cockroachlabs/support#1830) it would be useful to be able to get a better picture of the storage layer over a keyspan: eg, number of keys in each level, and what kinds. Maybe it could replace the specific DB.EstimateDiskUsage function.

See cockroachdb/cockroach#94659 for the cockroach companion issue.

@sumeerbhola
Copy link
Collaborator

@sumeerbhola
Copy link
Collaborator

sumeerbhola commented Mar 2, 2023

We would want stats to count the internal keys (and bytes) and the keys covered by range tombstones (and classify them into whether they can be cheaply seeked over during iteration or not).

And pace the scan, say 2MB/s (or configurable in the sql statement), so it does not impact foreground traffic.

raggar added a commit to raggar/pebble that referenced this issue Jul 21, 2023
Created a new function `ScanStatistics` that returns counts of the
different key kinds in Pebble (by level) as well as the number of
snapshot keys. Also modified `ScanInternal` to surface the level of each
key within each visitor function.

Informs: cockroachdb#1996
raggar added a commit to raggar/pebble that referenced this issue Jul 25, 2023
Created a new function `ScanStatistics` that returns counts of the
different key kinds in Pebble (by level) as well as the number of
snapshot keys. Also modified `ScanInternal` to surface the level of each
key within each visitor function.

Informs: cockroachdb#1996
raggar added a commit to raggar/pebble that referenced this issue Jul 25, 2023
Created a new function `ScanStatistics` that returns counts of the
different key kinds in Pebble (by level) as well as the number of
snapshot keys. Also modified `ScanInternal` to surface the level of each
key within each visitor function.

Informs: cockroachdb#1996
raggar added a commit to raggar/pebble that referenced this issue Jul 25, 2023
Created a new function `ScanStatistics` that returns counts of the
different key kinds in Pebble (by level) as well as the number of
snapshot keys. Also modified `ScanInternal` to surface the level of each
key within each visitor function.

Informs: cockroachdb#1996
raggar added a commit to raggar/pebble that referenced this issue Jul 25, 2023
Created a new function `ScanStatistics` that returns counts of the
different key kinds in Pebble (by level) as well as the number of
snapshot keys. Also modified `ScanInternal` to surface the level of each
key within each visitor function.

Informs: cockroachdb#1996
raggar added a commit to raggar/pebble that referenced this issue Jul 25, 2023
Created a new function `ScanStatistics` that returns counts of the
different key kinds in Pebble (by level) as well as the number of
snapshot keys. Also modified `ScanInternal` to surface the level of each
key within each visitor function.

Informs: cockroachdb#1996
raggar added a commit to raggar/pebble that referenced this issue Jul 27, 2023
Created a new function `ScanStatistics` that returns counts of the
different key kinds in Pebble (by level) as well as the number of
snapshot keys. Also modified `ScanInternal` to surface the level of each
key within each visitor function.

Informs: cockroachdb#1996
raggar added a commit to raggar/pebble that referenced this issue Jul 27, 2023
Created a new function `ScanStatistics` that returns counts of the
different key kinds in Pebble (by level) as well as the number of
snapshot keys. Also modified `ScanInternal` to surface the level of each
key within each visitor function.

Informs: cockroachdb#1996
raggar added a commit to raggar/pebble that referenced this issue Jul 27, 2023
Created a new function `ScanStatistics` that returns counts of the
different key kinds in Pebble (by level) as well as the number of
snapshot keys. Also modified `ScanInternal` to surface the level of each
key within each visitor function.

Informs: cockroachdb#1996
raggar added a commit to raggar/pebble that referenced this issue Jul 27, 2023
Created a new function `ScanStatistics` that returns counts of the
different key kinds in Pebble (by level) as well as the number of
snapshot keys. Also modified `ScanInternal` to surface the level of each
key within each visitor function.

Informs: cockroachdb#1996
raggar added a commit to raggar/pebble that referenced this issue Jul 27, 2023
Created a new function `ScanStatistics` that returns counts of the
different key kinds in Pebble (by level) as well as the number of
snapshot keys. Also modified `ScanInternal` to surface the level of each
key within each visitor function.

Informs: cockroachdb#1996
raggar added a commit to raggar/pebble that referenced this issue Jul 31, 2023
Created a new function `ScanStatistics` that returns counts of the
different key kinds in Pebble (by level) as well as the number of
snapshot keys. Also modified `ScanInternal` to surface the level of each
key within each visitor function.

Informs: cockroachdb#1996
raggar added a commit to raggar/pebble that referenced this issue Jul 31, 2023
Created a new function `ScanStatistics` that returns counts of the
different key kinds in Pebble (by level) as well as the number of
snapshot keys. Also modified `ScanInternal` to surface the level of each
key within each visitor function.

Informs: cockroachdb#1996
raggar added a commit to raggar/pebble that referenced this issue Aug 1, 2023
Created a new function `ScanStatistics` that returns counts of the
different key kinds in Pebble (by level) as well as the number of
snapshot keys. Also modified `ScanInternal` to surface the level of each
key within each visitor function.

Informs: cockroachdb#1996
raggar added a commit to raggar/pebble that referenced this issue Aug 1, 2023
Created a new function `ScanStatistics` that returns counts of the
different key kinds in Pebble (by level) as well as the number of
snapshot keys. Also modified `ScanInternal` to surface the level of each
key within each visitor function.

Informs: cockroachdb#1996
raggar added a commit to raggar/pebble that referenced this issue Aug 1, 2023
Created a new function `ScanStatistics` that returns counts of the
different key kinds in Pebble (by level) as well as the number of
snapshot keys. Also modified `ScanInternal` to surface the level of each
key within each visitor function.

Informs: cockroachdb#1996
raggar added a commit to raggar/pebble that referenced this issue Aug 1, 2023
Created a new function `ScanStatistics` that returns counts of the
different key kinds in Pebble (by level) as well as the number of
snapshot keys. Also modified `ScanInternal` to surface the level of each
key within each visitor function.

Informs: cockroachdb#1996
raggar added a commit to raggar/pebble that referenced this issue Aug 1, 2023
Created a new function `ScanStatistics` that returns counts of the
different key kinds in Pebble (by level) as well as the number of
snapshot keys. Also modified `ScanInternal` to surface the level of each
key within each visitor function.

Informs: cockroachdb#1996
raggar added a commit to raggar/pebble that referenced this issue Aug 2, 2023
Created a new function `ScanStatistics` that returns counts of the
different key kinds in Pebble (by level) as well as the number of
snapshot keys. Also modified `ScanInternal` to surface the level of each
key within each visitor function.

Informs: cockroachdb#1996
raggar added a commit to raggar/pebble that referenced this issue Aug 2, 2023
Created a new function `ScanStatistics` that returns counts of the
different key kinds in Pebble (by level) as well as the number of
snapshot keys. Also modified `ScanInternal` to surface the level of each
key within each visitor function.

Informs: cockroachdb#1996
raggar added a commit to raggar/pebble that referenced this issue Aug 2, 2023
Created a new function `ScanStatistics` that returns counts of the
different key kinds in Pebble (by level) as well as the number of
snapshot keys. Also modified `ScanInternal` to surface the level of each
key within each visitor function.

Informs: cockroachdb#1996
raggar added a commit to raggar/pebble that referenced this issue Aug 2, 2023
Created a new function `ScanStatistics` that returns counts of the
different key kinds in Pebble (by level) as well as the number of
snapshot keys. Also modified `ScanInternal` to surface the level of each
key within each visitor function.

Informs: cockroachdb#1996
raggar added a commit to raggar/pebble that referenced this issue Aug 3, 2023
Created a new function `ScanStatistics` that returns counts of the
different key kinds in Pebble (by level) as well as the number of
snapshot keys. Also modified `ScanInternal` to surface the level of each
key within each visitor function.

Informs: cockroachdb#1996
raggar added a commit to raggar/pebble that referenced this issue Aug 3, 2023
Created a new function `ScanStatistics` that returns counts of the
different key kinds in Pebble (by level) as well as the number of
snapshot keys. Also modified `ScanInternal` to surface the level of each
key within each visitor function.

Informs: cockroachdb#1996
raggar added a commit to raggar/pebble that referenced this issue Aug 3, 2023
Created a new function `ScanStatistics` that returns counts of the
different key kinds in Pebble (by level) as well as the number of
snapshot keys. Also modified `ScanInternal` to surface the level of each
key within each visitor function.

Informs: cockroachdb#1996
raggar added a commit that referenced this issue Aug 3, 2023
Created a new function `ScanStatistics` that returns counts of the
different key kinds in Pebble (by level) as well as the number of
snapshot keys. Also modified `ScanInternal` to surface the level of each
key within each visitor function.

Informs: #1996
@raggar raggar closed this as completed Aug 18, 2023
@jbowens jbowens moved this to Done in [Deprecated] Storage Jun 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Archived in project
Development

No branches or pull requests

4 participants