Skip to content

Add support for temporary tables in bulk updates #26

Open
@anpv

Description

@anpv

It would be good to use temporary tables in bulk updates.

// Case 1
var ids = Enumerable.Range(1, 100_000).Select(i => (long)i);
session.Query.All<SomeEntity>()
    .Where(c => c.Id.In(ids))
    .Set(c => c.SomeProperty, false)
    .Update();

// Case 2
var q1 = session.Query.All<SomeEntity>().Where(c => c.Id.In(ids));
session.Query.All<SomeEntity>()
    .Where(c => q1.Contains(c))
    .Set(c => c.SomeProperty, false)
    .Update();

// Case 3
var values = Enumerable.Range(1, 10_000).Select(i => $"Value {i}");
var q2 = session.Query.Store(values);
session.Query.All<SomeEntity>()
    .Where(c => q2.Any(v => v == c.Value))
    .Set(c => c.SomeProperty, false)
    .Update();

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions