Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Index problem

Index problem

From: Gregert Johnson <gregj_at_ctron.com>
Date: Thu, 13 May 1999 10:37:02 -0400
Message-ID: <373AE38E.2761ABEB@ctron.com>


I have a problem with an index which has been puzzling me. The index is on a single integer-valued column, non-unique. After a considerable amount of insert/delete activity, a state is reached where what should be fast queries are no longer so, in particular:

    SELECT MIN(COL) FROM TABLE; runs slowly (COL = indexed column), whereas

    SELECT MAX(COL) FROM TABLE; runs very quickly, as expected. Query plans for both queries indicate identical plans, i.e. using a scan on the relevant index rather than the table, but only the SELECT MAX() works properly. Evidently, something strange happens to the B-tree which makes it difficult to locate the low key, but not the high key. Rebuilding the index with ALTER INDEX REBUILD UNRECOVERABLE fixes the problem, i.e. SELECT MIN() is fast again.

Can anyone offer an explanation of what is causing this, and how to avoid it?

Thanks.

Received on Thu May 13 1999 - 09:37:02 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US