Say I have a composite index consisting of the fields (commentId, journalEntryId, owning_comment_id )
.
Now let's say that I have the following query:
UPDATE comments c
SET c.acceptedAsAnswer = isAnswer
WHERE c.id = commentId
AND c.journal_entry_id = journalEntryId
AND c.owning_comment_id IS NULL;
As you can see c.owning_comment_id
should be NULL
. Will the database still use the composite index in this case?