ui: show estimated schema change progress
We have at least two places where having an efficient way to compute the estimated length of a table is valuable.
- column showing the size of a table.
- column showing the progress made by a schema change. A schema change is aware of how may rows it has processed but is unable to know how many rows are yet unprocessed.
Having an estimate is good enough for both these use cases.
Jira issue: CRDB-6139
number of ranges * estimated number of rows per range
is one solution
We already track keys per range and the schema change op could track the number of keys it processed.
On Thursday, October 27, 2016, vivekmenezes [email protected] wrote:
number of ranges * estimated number of rows per range
is one solution
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/cockroachdb/cockroach/issues/10265#issuecomment-256664339, or mute the thread https://github.com/notifications/unsubscribe-auth/AF6f95ahtzaHi1aYdMcGELzq79vemSuOks5q4LqtgaJpZM4KicVZ .
(sent this via e-mail, but it didn't show up in the issue)
Is keys-per-range a good estimate of rowcount? We need to pin down how that number interacts with, for example, column families. I'm pretty sure that interleaved tables also throw a wrench into this.
If we could get a per-range count of keys into these specific categories, we could provide accurate stats with our current fan-out system.
exceptionally excellent
Is keys-per-range a good estimate of rowcount? We need to pin down how that number interacts with, for example, column families. I'm pretty sure that interleaved tables also throw a wrench into this.
If we could get a per-range count of keys into these specific categories, we could provide accurate stats with our current fan-out system.
On Thu, Oct 27, 2016 at 11:36 AM, Peter Mattis [email protected] wrote:
We already track keys per range and the schema change op could track the number of keys it processed.
On Thursday, October 27, 2016, vivekmenezes [email protected] wrote:
number of ranges * estimated number of rows per range
is one solution
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub <https://github.com/cockroachdb/cockroach/issues/ 10265#issuecomment-256664339>, or mute the thread <https://github.com/notifications/unsubscribe-auth/ AF6f95ahtzaHi1aYdMcGELzq79vemSuOks5q4LqtgaJpZM4KicVZ>
.
— You are receiving this because you were assigned. Reply to this email directly, view it on GitHub https://github.com/cockroachdb/cockroach/issues/10265#issuecomment-256677887, or mute the thread https://github.com/notifications/unsubscribe-auth/AGpaAly2UoZF5n2uHyygciAOzeQ3DUOKks5q4MTkgaJpZM4KicVZ .
Is keys-per-range a good estimate of rowcount?
No, but why do we need an estimate of the row count to compute schema change progress? If we had an estimated row count we could certainly use it to estimate schema change progress, but we could also use an estimate of key count because the schema changer could keep track of the number of keys it has processed.
The schema changer would do well with an estimate, even a query optimizer might do well with an estimate, but what do we want to display in the UI? I'm assuming that it's probably okay to display estimates that are significantly inexact due to previously mentioned issues (column families, interleaved tables); one would need only to run a SELECT COUNT(*) on a table to show a pretty big discrepancy. Assuming it's not computationally expensive, wouldn't we want more exact information available?
I think this issue has conflated the two problems listed in the original message. We don't need the same mechanism to solve both problems. I'm proposing we punt on the UI row count problem and solve the schema change progress problem by using key counts.
Assuming it's not computationally expensive, wouldn't we want more exact information available?
Yes, but I haven't heard a good way to do this. In a previous message you pointed out how column families and interleaved tables make any sort of row count from key count estimation complex. Did I miss something you were proposing here?
I seem to remember that we were doing this in order to track progress of schema changes? If so, haven't we done that? @jordanlewis Can we close out?
No, this is still a useful feature to have. The issue summary contains another use case besides schema change progress, and schema change progress could be more fine-grained if we had a row count estimate. Currently, schema change progress relies on the coarse-grained estimation strategy of considering the number of ranges touched by the keyspan of the primary index of the table to backfill.
Ok, thanks! It doesn't sound like there is any immediate need to work on this, so I've left it under the "later" milestone for now.
Since #9434 tracks just wanting an estimated row count (useful in & of itself), I'm renaming this issue to reflect the focus on schema change progress.
Don't we already have this implemented at least for some schema changes (column and index backfill)?
cc @lucy-zhang @ajwerner
Yeah, we already track the backfill progress. One problem is that the progress doesn't include the queries used for constraint or index validation (which could be most of the schema change running time).
I think @dt was thinking about hooking up query progress to the schema change job progress.
I hacked on adding query progress to SHOW QUERIES as a free-friday project last year with an eye towards making EXPORT a job one day, but didn't go any further than that. I'm not sure if SQL folks maintained progress support in vectorized queries so it might have rotted.
We have marked this issue as stale because it has been inactive for 18 months. If this issue is still relevant, removing the stale label or adding a comment will keep it active. Otherwise, we'll close it in 10 days to keep the issue queue tidy. Thank you for your contribution to CockroachDB!