Name field index implications with special characters
Last updated 2021-05-26 ·Reference W-2691232 ·Reported By 10 users
Name field with only special characters won't use index while executing the query. It is a expected behavior.
While executing the query if the name lookup field has only special characters, index will not be used while driving the query. If the object has more than 100,000 records, you will receive " non-selective query error" in trigger context.
You can query on any object Name field.
Select id, name, keywords From Document Where name='**&&'
You can either add alphanumeric name values to Name field filter or add more indexed filters to the query to avoid this error/improve the performance of the query.
Salesforce team has created the document bug to update in our documentation.
Is it Fixed?
Any unreleased services, features, statuses, or dates referenced in this or other public statements are not currently available and may not be delivered on time or at all. Customers who purchase our services should make their purchase decisions based upon features that are currently available.