Consultor Eletrônico



Kbase P82519: Query causes more database accesses in ODBC than Java
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   02/06/2004
Status: Unverified

FACT(s) (Environment):

Progress 9.1D

FACT(s) (Environment):

MERANT 3.60 32-BIT Progress SQL-92

SYMPTOM(s):

Simple SELECT statement that returns one record

When executed from SQL Explorer the query causes few (less than 5) database accesses

When executed from an ODBC based application the query causes many (1,000+) database accesses

CAUSE:

When running in SQL Explorer, the first time the query is executed many database accesses happen due to the both the query optimizer reading its tables and the fetching of the schema information).

When running from an ODBC based application, the first time the query is executed many database accesses happen due to the fetching of schema information. The number is database accesses is greater than for Java because ODBC fetches schema information on a field by field basis (i.e. many ODBC API calls are made).

When the query is executed a second time in either environment only four (4) database accesses are made.

FIX:

This is normal behavior and should be considered part of the overhead of using ODBC. If the same SQL statement is executed many times during the execution of the application consider using prepared statements rather than simply passing the string to the ODBC driver to execute. Doing this will reduce the schema download overhead to one time (the initial call).