performance - slow query using JDBC, Oracle 11g -


i have issue query in oracle; there table dit_numbers_asig, when execute query in way:

select *  dit_numbers_asig  number_asig = '1234567'; //quotes 

the query executed immediately; if execute query:

select *  dit_numbers_asig  number_asig = 1234567; //without quotes 

the query slow, it's take around 2 minutes.

the problem when try execute statement java application (using jdbc):

select *  dit_numbers_asig  number_asig = '1234567'; 

the query slow, if quotes doesn't exist.

how can execute query quotes, because if query doesn't had quotes

i don't see big difference when executing query mentioned on sqlfiddle. have added few rows 1 table , trying retrieve specific row passing value mentioned above (with , without quote). see no difference whatsoever.

sql fiddle demo

the possible solution :.

  1. consider adding index table.
  2. specify column name instead of using * in select statement.

you may consider check oracle doc sql tuning.


Comments