Subject Re: delete with null not executed
Author hybriszero
--- In, "hybriszero" <hybriszero@...>
> so instead of doing
> delete ... where x=?
> i now do
> delete ... where x=? or (?=0 and x is null)

this works but unfortunately it changes the execution plan for a query
with a where clause of 1 column (the primary key)

version 1:
select bla bla from table where id=100

version 2:
select bla bla from table where id=100 or (1=0 and id is null)


PLAN (A INDEX (PK_LogRichieste))


PLAN (A INDEX (PK_LogRichieste, PK_LogRichieste))

this is a query i do to check if in the destination db the record is
already present so i choose between insert or update.

i don't know what the second plan exactly means but it destroys the

In my test, doing an takes less that 1 ms with the first one
and about 200 with the second one.

I have to process thousands and thousand of records...