I have a simple query in an Apex trigger:
SELECT Id, Name FROM Account WHERE Name in :Names
where :Names is a set of strings
Set<String> Names = new Set<String>();
This query fails with System.QueryException: Non-selective query against large object type (more than 100000 rows) when the set contains '.' string.
Names.add( '.' );
Can anyone explain this behavior? Does the dot character have a special meaning in SOQL?
By the way, the account record with the weird name "." exists if this is important.
Update. There are more than 100000 accounts, most of them are unique. I can select the accounts using Developer Console:
As you can see, 2 records are selected. The exception rises when I try to reproduce the query in a trigger. I've created the most simple trigger that causes the exception:
trigger testTrigg on Contact (after insert) {
Account[] accounts = [select Id, Name from Account where Name in ('.') limit 100];
}
Then I tried to create a contact and got the exception:
As I see, I get a different query plan depends on value of searching. '.' value is surprisingly equal to NULL.