Single-column vs composite index

From: Sandra Becker <sbecker6925_at_gmail.com>
Date: Tue, 1 Dec 2015 12:33:55 -0700
Message-ID: <CAJzM94CK45icuYCN-9cFeSx30jyC7iWcJAdX7bKfGQm6xpZkDw_at_mail.gmail.com>



Oracle EE 11gR2

Still learning all the ins/outs at my new job. One thing I had noticed is that all indexes are single column. When I asked about it, I was told this was the current policy. I also was told that if I could show a composite index would be more efficient without breaking anything (always a concern), it would be considered.

I've used both single-column and composite in the past and my take is that for index creation "it depends" on the table design, the code, execution frequency of certain pieces of code, any existing performance issues, is there a problem you're trying to solve, or is this just STD (SQL Tuning disorder), can other queries benefit from the same index, etc. At the moment, we see the occasional bottleneck. I'm continuing to monitor to see the frequency and duration.

So using OEM, AWR, ad hoc queries, explain plans, etc., I have identified several queries that are "ANDing" indexes yet still have a high cost and over 10,000 buffer gets for a single execution. I am not opposed to "ANDing" at all and think it definitely improves performance in many cases.

Question: In your experience, would a composite index have better/worse/similar performance than "ANDing" two indexes? At the moment, I don't have a place to test, but I am working on it.

-- 
Sandy B.

--
http://www.freelists.org/webpage/oracle-l
Received on Tue Dec 01 2015 - 20:33:55 CET

Original text of this message