Skip to content

Temp Tables for big delete queries don't work for UUIDs #46

@martinzellner

Description

@martinzellner

Hello,

we are stuggeling with the following issue:

I'm running a big delete query with ~ 17000 entries:
Model.objects.filter(pk__in=delete_list).delete()

What mssql-django does is to create a temp-table to not exceeed the maximum number of parameters:
CREATE TABLE #Temp_params (params nvarchar(32))
INSERT INTO #Temp_params VALUES ('fe5633e3-5ad9-471a-9046-000364aada58'),

Unfortunately my primary key is a UUID and hence has 36 characters. Wouldn't it make more sense to create a temp table that has the same datatype as the field to be filtered for?

Thanks in adavance for your help.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions