Re: OCI performance mistery

From: Richard Bennett <73501.1703_at_compuserve.com>
Date: 1996/01/15
Message-ID: <30FAAFF1.2C4A_at_compuserve.com>#1/1


In article <30F0156E.4F4F61EE_at_lvalue.com>, vlads_at_lvalue.com says...

>I am new to oracle - i used sybase for many years. The problem
>i am experiencing is related to OCI access to oracle; we have a very
>simple and rather small table - just 8 columns (datatypes NUMBER,
>DATE and VARCHAR2). The table is just 2,000 rows. The table does
>not have indexes, though, since no column is a key (or any column
>can be a key).
>
>Anyway, when i run sqlplus against this table, the responce time
>for a simple query (no join here) is wery short, the rows come
>almost immediately, which is expected. But when i run our application,
>which does the same exact query through OCI - it might take up to
>30 sec for the same query, which is ridiculous.

I am not sure, but I guess you are not using an array fetch in your OCI code.

An array fetch is when a query grabs a chunk of records all at once (say 15 records in a chunk). Array fetches are fast. When you run your query in SQL*Plus, Oracle is using an array fetch. Pro*C and OCI calls do not use the array fetch by default; rather, they fetch one row at a time. Rewrite your OCI code to use an array fetch.

Hope this helps.

-- 
===============================================================
Richard Bennett		E-Mail: richhb_at_sequent.com
				73501.1703_at_compuserve.com
Computer People Inc.	On contract to Sequent Computer Systems
Received on Mon Jan 15 1996 - 00:00:00 CET

Original text of this message