Some indexes not used in JDBC call



Hello everyone,

I'm having a problem where a JDBC PreparedStatement without bind
parameters can take more than a minute to execute a query that takes
less than a second to execute in SQL*Plus. The query is identical, the
database instance is the same, neither query is cached, and the query
returns only 18 records with 11 columns all of which are either
VARCHAR2 or NUMBER. I'm using Oracle's JDBC 2.0 drivers
(classes12.jar) and Oracle 8i (Release 8.1.7.4.0) database. Oracle DB
is set to use the cost-based optimizer.

I did an explain plan in SQL*Plus and via JDBC. It turns out that some
of the unique indexes that are used when executing the query in
SQL*Plus are not used when executing via JDBC.

Does anyone know why this would happen?

Thanks,
Sam

.



Relevant Pages

  • RE: Oracle 10g and DBD::Oracle
    ... Where are the bind variables? ... before and after my query block. ... The above SQL Block creates only 1 cursor not 2. ... >the same sql query when I execute a SELECT statement via my small ...
    (perl.dbi.users)
  • Re: Finally which ORM tool?
    ... manipulate the linq query IF you're executing it at that moment. ... simply because the declaration construction was with 'CHOPS'. ... implement IEnumerablebut had an Execute() method which gave back ...
    (microsoft.public.dotnet.languages.csharp)
  • RE: SQL stored procedure executing twice
    ... I wasn't aware that DLookupwould execute the "domain" more than once. ... caused the stored procedure to execute twice. ... Dim stDocName As String ... My pass-thru query properties ...
    (microsoft.public.access.modulesdaovba)
  • Re: JDBC Driver extremely slow??
    ... I try to run a query on Oracle Enterprise v10.2.0.1.0 when I execute it on iSQL+ it returns the results in milisecs. ... However when I execute the same query using the JDBC driver Oracle tries too hard to process it. ...
    (comp.databases.oracle.server)
  • Re: Some indexes not used in JDBC call
    ... the fact that SQL*plus and JDBC are not using the same version of TTC ... JDBC-Thin is pure Java and has to turn each release ... less than a second to execute in SQL*Plus. ... The query is identical, the ...
    (comp.lang.java.databases)