开发者

Significance of parameter names in oracle trace files

开发者 https://www.devze.com 2023-01-30 06:36 出处:网络
I am comparing results of two different JDBC drivers of oracle with the help of oracle\'s SQL tracing capabilities. I am using TKProf to format the results.

I am comparing results of two different JDBC drivers of oracle with the help of oracle's SQL tracing capabilities. I am using TKProf to format the results.

When I look at the output of TKProf sometimes I see parameters named prefixed with 'v':

WHERE start_time BETWEEN  :v0  AND  :v1

At other instances the parameters are not prefixed:

WHERE start_time BETWEEN :1 AND :2

I suspect that in second case, query optimizer is not picking some indices.

Is there a hint in the na开发者_高级运维ming convention of parameters?


I'm certainly not an expert in how the JDBC drivers talk to the database. With luck, someone else will provide that detail.

I believe, though, that the parameter names shouldn't mean anything. That should just be what the particular driver decides to call them when it's sending the query to the database. But if you can peek at the actual values of the bind variables, that might tell you something. My concern would be that one driver is setting it up so the values have to go through a cast on the way to running the query, which could affect index use.


They're private bind variable names picked by the client software; possibly in your Java code the query has between ? and ? which has to be translated to something Oracle will understand. The names are almost irrelevant - certainly nothing to do with indexes or optimisation. I say 'almost' because I'm not sure if Oracle will see them as the same query, or will do separate hard parses of each.

0

精彩评论

暂无评论...
验证码 换一张
取 消