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

VPC Subnet insertion query is not efficient #1221

Open
bnaecker opened this issue Jun 16, 2022 · 0 comments
Open

VPC Subnet insertion query is not efficient #1221

bnaecker opened this issue Jun 16, 2022 · 0 comments
Labels
database Related to database access enhancement New feature or request. networking Related to the networking.

Comments

@bnaecker
Copy link
Collaborator

In the query for inserting a VPC Subnet, we look for the existence of overlapping IP subnets from other VPC Subnets already in the same VPC. That's done here, with a call to the CockroachDB function inet_contains_or_equals. That is correct, but pretty inefficient if the VPC starts to get a lot of subnets. We're using an index on the vpc_subnet table on the vpc_id column, but we'll still need to do a full scan of that index. That's better than a table scan, but not great.

We could instead store the first and last address of each VPC Subnet's IP subnets (both v4 and v6). A unique index on each of these would be great, and would support fast lookups of overlapping subnets. An existing subnet containing the candidate is one where the first and last addresses are before and after the first address of the candidate, respectively. An existing subnet contained by the candidate is one where the first address is between the candidate's first and last address.

@bnaecker bnaecker added enhancement New feature or request. networking Related to the networking. database Related to database access labels Jun 16, 2022
leftwo added a commit that referenced this issue Mar 29, 2024
Propolis changes:
Add `IntrPin::import_state` and migrate LPC UART pin states (#669)
Attempt to set WCE for raw file backends
Fix clippy/lint nits for rust 1.77.0

Crucible changes:
Correctly (and robustly) count bytes (#1237)
test-replay.sh fix name of DTrace script (#1235)
BlockReq -> BlockOp (#1234)
Simplify `BlockReq` (#1218)
DTrace, cmon, cleanup, retry downstairs connections at 10 seconds.
(#1231)
Remove `MAX_ACTIVE_COUNT` flow control system (#1217)

Crucible changes that were in Omicron but not in Propolis before this commit.
Return *410 Gone* if volume is inactive (#1232)
Update Rust crate opentelemetry to 0.22.0 (#1224)
Update Rust crate base64 to 0.22.0 (#1222)
Update Rust crate async-recursion to 1.1.0 (#1221)
Minor cleanups to extent implementations (#1230)
Update Rust crate http to 0.2.12 (#1220)
Update Rust crate reedline to 0.30.0 (#1227)
Update Rust crate rayon to 1.9.0 (#1226)
Update Rust crate nix to 0.28 (#1223)
Update Rust crate async-trait to 0.1.78 (#1219)
Various buffer optimizations (#1211)
Add low-level test for message encoding (#1214)
Don't let df failures ruin the buildomat tests (#1213)
Activate the NBD server's psuedo file (#1209)

---------

Co-authored-by: Alan Hanson <alan@oxide.computer>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
database Related to database access enhancement New feature or request. networking Related to the networking.
Projects
None yet
Development

No branches or pull requests

1 participant