Re: small table takes more time as compared to bigger table

From: onedbguru <onedbguru_at_yahoo.com>
Date: Tue, 17 May 2011 17:50:17 -0700 (PDT)
Message-ID: <438558c9-b016-43da-b652-533b7fa61f8a_at_gu8g2000vbb.googlegroups.com>



On May 17, 5:42 pm, John Hurley <hurleyjo..._at_yahoo.com> wrote:
> MadhavC:
>
> # I run the query as below for 16000 times for different values of
> col4 in where clause-
>
> Don't do that ... don't run any query 16000 times ... use SQL and join
> things together so that you run the query once.
>
> Give Oracle as much work as is needed to be done in as few statements
> as possible ...

I second that.. Sounds like you need to learn what a cursor is and how to get all of the values at once and loop through the cursor.

From the orignial post
>>I have another table - TABLE2 (having total only 1000 rows) col1, col4, col6
>>...
>> I run the following query for 16000 times for different values of col4
>> in where clause
>> select col1, col4, col6 from TABLE2 where col4='SOMEVALUE'

Sounds like you are doing 15K times more work than necessary If you only have 1000 rows how can you have 16K different rows for col1,col4,col6? Received on Tue May 17 2011 - 19:50:17 CDT

Original text of this message