forked from cockroachdb/cockroach
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
91704: *: Improve constraints retrieval in table descriptor r=Xiang-Gu a=Xiang-Gu This PR tries to improve how we retrieve constraints in a table descriptor. Previously, it was mostly legacy code carries over from a while ago and nothing hasn't really changed. The main change is to introduce `catalog.Constraint` interface, similar to `catalog.Index` and `catalog.Column`, as the preferred interface for constraint in this layer. Previously, we would directly expose the underlying protobuf descriptor. Commit 1 (easy): Rename `catalog.ConstraintToUpdate` to `catalog.Constraint`. It's good that we already have an interface that is suitable to be used for our effort. Commit 2 (easy): Added methods in just renamed `catalog.Constraint` interface for index-backed-constraints (i.e. PRIMARY KEY or UNIQUE); Commit 3 (easy): Let `tabledesc.index` struct implement `catalog.Constraint` interface as we will use it for index-backed-constraints. Commit 4 (easy): Add a method in `catalog.Constraint` that gets validity of the constraint. Commit 5 (moderate): Add logic (`ConstraintCache`) to pre-compute all constraints in a table, categorized by type and validity, so that we can readily retrieve them later. This is the same idea/technique used for managing index and columns (in `IndexCache` and `ColumnCache`). Commit 6 (easy): Introduce the new, preferred methods in `catalog.TableDescriptor` to retrieve constraints from a table. Commit 7 (easy): Refactor signature of the existing `FindConstraintWithID` method to use the newly added interface and retrieval methods. Informs: cockroachdb#90840 (this PR can unblock cockroachdb#90840) Release note: None 91867: ui: change height of column selector r=maryliag a=maryliag Previosuly, it was hard to identify there was more items on the columns selector, since the scrollbar is confugured by the user and might not show up right away (it will show once you hover with mouse and scroll). This commit changes the height of the filter, making part of the next options to show up, hinting there is more options when scrolling. Part Of cockroachdb#91763 Before <img width="322" alt="Screen Shot 2022-11-14 at 2 59 39 PM" src="https://user-images.githubusercontent.com/1017486/201755400-1276e45b-62b8-44c0-a7ff-c337090ad94a.png"> After <img width="308" alt="Screen Shot 2022-11-14 at 3 02 47 PM" src="https://user-images.githubusercontent.com/1017486/201755427-906e1c3b-e9fa-443b-9508-b2957b38d90b.png"> Release note (ui change): Change the height of column selector, so it can hint there are more options to be selected once scrolled. Co-authored-by: Xiang Gu <[email protected]> Co-authored-by: maryliag <[email protected]>
- Loading branch information
Showing
21 changed files
with
665 additions
and
74 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.