All Forums Analytics
snreyes 2 posts Joined 04/13
21 Jun 2016
CPU disk ratio error from 'like' statements

We are parsing out URL strings in code and are receiving a CPU disk ratio error message.  Can someone help identify the major contributors to CPU disk ratio error?
The below are all included in case statements creating new variables.  For example:
CASE WHEN URL LIKE ANY ( '%help%',’%travel%’ ) THEN 1 else 0 end AS variable_travel
·         Is there a limit of how many words can be included in a LIKE ANY statement?  (’%help%’,’%health%’,’%travel%’)
·         What is the effect of using NOT LIKE statements?   Should these be avoided? For example like any (’%help%’,’%health%’,’%travel%’)  and not like ‘%helpful%’
·         What is the effect of multiple wild cards such as  '%free_stuff%'

ToddAWalter 316 posts Joined 10/11
21 Jun 2016

Please share the error code and message being received? It sounds like a workload management rule that the system/performance administrators have put in place. There are no system limitations around complexity or number of expressions. If there are patterns to the strings being searched for, a review of the regex functions might be in order. 
Of of course more parsing means more CPU utilization but there are not system limits on that, only rules on workloads that are defined by the administrators and must be negotiated with that team. 

Johannes Vink 28 posts Joined 08/14
22 Jun 2016

Probably the like statements results in a full table scan and thus a high io/cpu estimate.
Here the effect is a bit explained:

You must sign in to leave a comment.