jmeter-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sebb <seb...@gmail.com>
Subject Re: Using literals with JDBC the sampler instead of bind variables
Date Wed, 29 Jul 2009 11:07:16 GMT
On 29/07/2009, welp <peter.welker@trivadis.com> wrote:
>
>  Hoi again,
>
>  for some JDBC tests, I need to send the same query with different filters
>  (where conditions) against an Oracle database. usually, I would use the
>  "prepared select statement" query type for that using bind variables. But
>  for the Oracle Query Optimizer it can be a big difference when calculating
>  its execution plan if I use Bind Variables or if I use literals. Example:
>
>  select count(*) from v_whatever where xyz = ?    -- (with ? replaced by 4711
>  when preparing the statement)
>  or
>  select count(*) from v_whatever where xyz = 4711
>
>  ... can lead to very different executions plans and therefore also lead to
>  very different response times. Usually the execution plan that I get when
>  using literals (4711 directly instead of a ? in the prepared statement) is
>  often better - even Oracle completely needs to hard-parse the statement with
>  the literal - for long running queries in data warehouses, using literals
>  can lead to faster responses.
>
>  Hence I need to test it with literals but I want to get the literals from a
>  CSV file and not hard-code it into multpile JDBC samplers.
>
>  Is there a way to do this?

Yes - just use CSV Dataset and code as follows:

select count(*) from v_whatever where xyz = ${NUMBER} and name="${NAME}"

Note that you need to add quotes for strings.

>  Thanks a lot in advance!
>  Regards
>  Peter
>
> --
>  View this message in context: http://www.nabble.com/Using-literals-with-JDBC-the-sampler-instead-of-bind-variables-tp24716871p24716871.html
>  Sent from the JMeter - User mailing list archive at Nabble.com.
>
>
>  ---------------------------------------------------------------------
>  To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
>  For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-user-help@jakarta.apache.org


Mime
View raw message