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

Add optimizations for primary key queries #4895

Open
DCNick3 opened this issue Jul 25, 2024 · 0 comments
Open

Add optimizations for primary key queries #4895

DCNick3 opened this issue Jul 25, 2024 · 0 comments
Labels
Enhancement New feature or request queries

Comments

@DCNick3
Copy link
Contributor

DCNick3 commented Jul 25, 2024

TL;DR

After #4833 lands, there will be a degradation in performance of primary-key queries compared to before (linear scan is being used instead of looking up a map). An special case should be created for the primary-key queries, as outlined in #4833 (comment):

let iter: Box<dyn Iterator<Item = Domain>> = match filter {
    CompoundPredicate::Atom(DomainPredicateBox::Id(DomainIdPredicateBox::Equals(
        domain_id,
    ))) => Box::new(Some(state_ro
        .world()
        .domain(&domain_id)?
        .clone())
        .into_iter()),
    filter => Box::new(
        state_ro
            .world()
            .domains_iter()
            .filter(move |&v| filter.applies(v))
            .cloned(),
    ),
};

Ok(iter)
@DCNick3 DCNick3 added Enhancement New feature or request queries labels Jul 25, 2024
@DCNick3 DCNick3 mentioned this issue Jul 25, 2024
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement New feature or request queries
Projects
Status: Required for MVP
Development

No branches or pull requests

2 participants