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

Home -> Community -> Mailing Lists -> Oracle-L -> RE: should you seperate indexes from tables in seperate datafiles?

RE: should you seperate indexes from tables in seperate datafiles?

From: Cary Millsap <cary.millsap_at_hotsos.com>
Date: Tue, 15 Jul 2003 11:18:22 -0500
Message-Id: <25929.337842@fatcity.com>


The thing that occurred to me a few years ago (as a result of a test designed by Craig Shallahamer) is that "what disks do" gets very, very complicated when you add users. On any system busy enough to have a performance problem, the odds are usually slim that a disk is just "sitting there" waiting for your next I/O call. On a busy system, someone else's I/O call is almost always going to intercede between two of *your* I/O calls.

As has been said many times, many ways...

Cary Millsap
Hotsos Enterprises, Ltd.
http://www.hotsos.com

Upcoming events:

- Hotsos Clinic 101 in Washington, Denver, Sydney
- Hotsos Symposium 2004, March 7-10 Dallas
- Visit www.hotsos.com for schedule details...


-----Original Message-----
From: ml-errors_at_fatcity.com [mailto:ml-errors_at_fatcity.com] On Behalf Of Daniel Fink
Sent: Tuesday, July 15, 2003 11:24 AM
To: Multiple recipients of list ORACLE-L Subject: Re: should you seperate indexes from tables in seperate datafiles?

I may be way off base here, so any gurus please correct me with a gentle slap to the back of the head...

Index and table access is not as simple as index entry..table row..index entry..table row..etc. I just ran a quick test (which may not be represntative and is using the primary key which can be understood as the row number in physical order of the data blocks) and I found (using the sequence of wait events) that there was substantial access to the index datafiles initially, followed by substantial access to the data datafiles. Then another single access to index, multiple access to data, single access to index, multiple access to data. It seems to me that this pattern is read several index blocks, then access several data blocks, read several index blocks, access several data blocks. This may be due to the sequential nature of the pk in the data blocks. It seems that the most efficient algorithm is to read enough index blocks to set up a list of data blocks to read, then go get them. Since you have the index block pinned, don't waste any resource in releasing the pin to pin the data blocks, then repin the index block.

The other issue is that indexes can be accessed using multiblock reads (index fast full scan) and tables can be indexed using single block reads (table access by rowid).

Garry Gillies wrote:
>
> It's hot here. I wish I was at the beach and I feel like a rant.
>
> "oracle actually accesses indexes and tables serially"
>
> Is it just me or is this blindingly obvious?
> You cannot access the table data until you have completed accessing the
> index data
> because the index data contains the location of the table data.
>
> During an indexed query on a single table the index will be accessed, then
> the table,
> then the index,then the table, then the index,then the table then the
> index,then the table.
> If the index and the table are on the same disk then a lot of time will be
> taken up by
> head seek movement.
> If they are on the different disks then the "index" heads can locate their
> data and stay
> there - and the "data" heads can locate their data and stay there.
> Less head movement, less wasted time.
>
> That is the argument for what it is worth. Real life is of course vastly
> more complex than
> this and we are swimming in very muddy waters, which is why there is so
> much
> argument on the subject (raid salesmen - spit).
Received on Tue Jul 15 2003 - 11:18:22 CDT

Original text of this message

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