Skip Navigation
Expand
Can't perform a select statement even with small limit in ROQL
Answer ID 12091   |   Last Review Date 02/15/2022

Why do I get "poor performing query" even when I only get one row of data?

Environment:
  • Oracle B2C Service, any version
  • Connect APIs (SOAP, REST, PHP), any version
  • Customizations using RightNow Object Query Language (ROQL)
Issue:
 
The following query returned Poor performing query - too many rows examined:
 
SELECT ID FROM Contact LIMIT 1
 
Cause:
 
The contacts table is large and/or linked to many custom objects. The LIMIT clause does not make the query examine fewer rows.
 
Resolution:
 
Include an appropriate WHERE clause in the query to reduce the number of rows scanned.
 
Notes:
 
See the documentation for the API you are using for further information on constructing ROQL queries. Each is linked from the answer Technical Documentation and Sample Code.