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

From: rich p <richg73p_at_gmail.com>
Date: Sat, 28 May 2011 03:07:47 -0700 (PDT)
Message-ID: <a92d5f19-6976-4e65-b7bc-8ff2da514847_at_glegroupsg2000goo.googlegroups.com>



..I noticed a few things that may be relevant to the discussion.

From the original post:
> I run the query as below for 16000 times for different values of col4
> in where clause-
> select col1, col4, col6 from TABLE1 where col4='SOMEVALUE'
> This finish in few milliseconds

> 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'

> TABLE1 and TABLE2 are indexed on col1.

My comments:
If the WHERE clause in queries for both tables are restricted on "col4", of what relevance is it to have an index on "col1"? Whatever optimization that was introduced by indexing col1 is most likely not even used.

Rich Pascual Received on Sat May 28 2011 - 05:07:47 CDT

Original text of this message