Skip to content

improve assigner to use aggregates where possible #147

@matt-beanland

Description

@matt-beanland

requires AshNeo4j 0.5.1 or later. Full benefit with 0.6.0 which optimises diffo-dev/ash_neo4j#253

Currently the Assigner does N queries per pool lookup, plus DefinedSimpleRelationship returns all :assignedTo relationships regardless of thing.

If rewritten to aggregates:

The filter has two conditions:

type == :assignedTo — scalar atom property, straight WHERE d.type = "assignedTo" in Cypher. This is the simplest possible case for #253
.
characteristic.name == thing — JSON-encoded embedded field. Can't be pushed to Cypher regardless, stays Elixir-side.

if we've know assigned then we shouldn't need to do another query for free, we can calculate locally by enumerating the pool and differencing to find free.

Metadata

Metadata

Assignees

No one assigned

    Labels

    refactoringImproving existing code without changing functionality

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions