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
30.19k stars 3.82k forks source link

sql: SHOW RANGES should not be controlled only by role options VIEWACTIVITY or ZONECONFIG #106684

Open knz opened 1 year ago

knz commented 1 year ago

Is your feature request related to a problem? Please describe.

Currently SHOW RANGES (and its underlying mechanisms via crdb_internal.ranges, ranges_no_leases) is limited to users with the options VIEWACTIVITY or ZONECONFIG.

This is overly restrictive: SHOW RANGES is also useful for DBAs and application developers:

Describe the solution you'd like

Related: #106682. Related: #103443.

Jira issue: CRDB-29677 Epic: CRDB-30635

koorosh commented 1 year ago

@knz , want to clarify following:

  1. As I understood, proposed base and advanced versions is not mutually exclusive. Is it correct? It is okay to have both implementations?
  2. Should VIEWCLUSTERMETADATA role have some limitations on information returned from SHOW RANGES (comparing to VIEWACTIVITY role)?
knz commented 1 year ago

(1) yes this is correct - both are possible.

(2) I don't know. Do we consider VIEWCLUSTERMETADATA to be "more" or 'less" powerful than VIEWACTIVITY? If we include range key details in the output, that will reveal the values of indexed columns. Is that acceptable for either of these role options?

maybe @j82w can chime in here.