> >In Oracle, because the ROWID is the actual physical address of the row, > >it provides O(1) access to a row, as opposed to O(log(n)) that an index > >provides. That's a pretty good benefit if you ask me. > > > > I'd love to see the math on that proven; I'm running it through my head > now and it doesn't jive ...
Like I said, the ROWID in Oracle is the *physical address* of the row. It's made up of three parts: datafile, block and offset. If you say: select * from some_table where rowid='RRRBBBBBBFFF'; It'll break the rowid up into the datafile (FFF in this case) and block (BBBBBB in this case), and load that directly into memory, then it'll take the offset within the block (RRR here) and fetch the row. That's an O(1) operation - it doesn't matter how many rows you've got in the table, you could have a billion rows and it's still the same amount of time as if you had 1 row. (I'm assuming you're not disputing my O(log(n)) for access via an index, since that's a pretty fundamental number). > Some logic ... statement 1: > > >The ROWID isn't stored by Oracle (except in your indexes). > > > ... does not coincide with statement 2: > > >It's "stored" in the same space that MySQL would allocate for > > > ... these are orthogonal statements. Please respond to the request, I'm > terribly confused about why you care so much about _rowid's still and > I'd love to understand. However, you seem to think that "its stored in > the same space ..." is different from "still taking up a few bytes per > row of memory ...". These seem like very compatible statements to me > (you're agreeing with what I said). I think I was a bit confusing here. When I say "stored" I mean there are no rowids stored in the datafile. Think of a rowid as being like a pointer in C. The memory required for the pointer itself isn't counted as being part of the memory required by the object it's pointing to. You don't save the pointer to disk when you write your data to disk (because it doesn't make sense to). It's the same with a rowid. If nothing is pointing to a particular row, then nothing is "stored" in memory either. It's only when something is pointing to a row that you'd need some memory to hold the rowid (for example an index has the rowids in it). Oracle calls the rowid "column" a pseudocolumn, because it's value is a function of the row itself, not any piece of data stored in the row. > So now they're storing two rowids? It's not really like that. The "new" style rowid has an extra value. The old one had datafile, block and offset. The new one has those three things, but it also has a segment part. Like I said, the reason the format was expanded in 8i was to allow for more than 1022 datafiles. So if you specify a rowid without the segment bit, it'll assume you're talking about a piece of data in one of the first 1022 datafiles. If you specify a rowid with the segment part, it can work out for itself which one you're talking about. --------------------------------------------------------------------- Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php