Screen.Name

SQL normalization for Hibernate

Discussion created by Screen.Name on Jun 29, 2015
Latest reply on Feb 23, 2017 by Screen.Name

If you have apps that use Hibernate you will be used to seeing SQL like this:

 

SELECT THIS_.FOO_BAR AS FOO1_658_0_, THIS_.SOME_THING AS SOME2_658_0_, THIS_.X_Y_Z AS X3_658_0_            
        FROM SomeTable THIS_ WHERE [...]


When the JVM restarts the numbers can change, and when the old version of the query is unmounted historical data disappears. The numbers are different in different agents so metric grouping expressions are a pain to write.

 

I am thinking of trying to normalize these and remove the numbers. Something like:


introscope.agent.sqlagent.normalizer.regex.key1.pattern=_[0-9]+_                                          

introscope.agent.sqlagent.normalizer.regex.key1.replaceAll=true                                           

introscope.agent.sqlagent.normalizer.regex.key1.replaceFormat=_

 

Has anyone tried this? The most obvious downside is that the SQL in Introscope no longer matches the SQL in the reports that the DBAs generate but I would like to know if it causes any other issues.

Outcomes