I have a questions that keep playing on my mind about the index relations with buffer gets on Oracle.
Is that true if I put on an Index and the buffer gets decreased then the Index is considered as worked well?
And is it also true that Index could also increase buffer gets and that considered as Index is not suitable for that query?
I really need an explanation for this questions. Thanks in advance! 🙂
An index is added to provide better access paths to data in tables, and/or to police a unique constraint.
Buffer gets is just a measure of how many blocks Oracle had to read in order to service a query. It might read each buffer from the buffer cache, or if not found, from disk.
Since most of the time taken by queries, generally, is in reading blocks (whether from the buffer cache or from disk), I’d expect that improving a query by giving it a better access path (e.g. by adding an index) should reduce the number of buffers required, rather than increase them.