Skip to content
This repository was archived by the owner on Sep 12, 2018. It is now read-only.
This repository was archived by the owner on Sep 12, 2018. It is now read-only.

[db] Don't collect as many intermediate data structures when looking up [a v] pairs #262

@ncalexan

Description

@ncalexan

This is follow-up to #214 (comment).

What's happening is that we have a map [a v] -> e expressed as a composition of maps:

  • [a v] -> temporary search id
  • temporary search id -> e entid from database

The latter map must be chunked into a number of sub-queries because SQLite allows to bind only a limited number of variables.

The reviewer correctly points out that we don't need to collect as many intermediate data structures. We could do this as iteration and a mutable map, although I think I prefer a big fold. A "fold-in-place" is best expressed as a for loop in Rust (per the documentation), which is what the reviewer asks for.

This ticket isn't quite ready, because the [a v] lookup code is likely to change a little with #184.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions