List:General Discussion« Previous MessageNext Message »
From:Jeremy Zawodny Date:November 8 2003 1:49am
Subject:Re: ROWID
View as plain text  
On Thu, Nov 06, 2003 at 01:02:31PM -0800, Mike Brando wrote:
> 
> > -----Original Message-----
> > On Thu, Nov 06, 2003 at 09:59:41AM -0800, Wan, Wenhua wrote:
> > > Hi there,
> > >
> > > Both Oracle and Informix use ROWID to uniquely represent the location of
> > > each row of data in a table.  ROWID is basically a hidden column or
> > > pseudocolumn for each table, and it is the fastest way to retrive a row
> > from
> > > a table.  Does MySql have similar field?  If is, what's the name and how
> > to
> > > access it?
> > >
> > > Thank you very much in advance for your advice.
> > 
> > http://www.mysql.com/doc/search.php?q=rowid
> > 
> 
> 
> Ok, so that search produces this:
> 
> " If the PRIMARY or UNIQUE key consists of only one column and this is of type
> integer, you can also refer to it as _rowid (new in Version 3.23.11)."

Yes.

> But that's not what a "ROWID" is compared to what I think the
> original poster was looking for.

One hopes he figured that out after reading the description.

> In Oracle for example, a ROWID is the unique address of a row in the
> database. Every row, unique key or not has a unique address. Is
> there such a thing in MySQL?

No.  If there was it'd be documented.  But at lesat with MyISAM
tables, MySQL cannot guarantee the "address" (or row number) of a
row.  An ALTER/REPAIR/OPTIMIZE may reorder the rows.

> ROWIDs are extremely useful for guaranteeing that you are
> manipulating the exact row that you think you are.

So I've been told.

Jeremy
-- 
Jeremy D. Zawodny     |  Perl, Web, MySQL, Linux Magazine, Yahoo!
<Jeremy@stripped>  |  http://jeremy.zawodny.com/

MySQL 4.0.15-Yahoo-SMP: up 55 days, processed 2,063,471,142 queries (433/sec. avg)
Thread
ROWIDWenhua Wan6 Nov
  • Re: ROWIDJeremy Zawodny6 Nov
    • RE: ROWIDMike Brando6 Nov
      • RE: ROWIDDathan Vance Pattishall6 Nov
      • Re: ROWIDChris Boget6 Nov
      • RE: ROWIDDaniel Kiss6 Nov
      • Re: ROWIDJeremy Zawodny8 Nov
        • Re: ROWIDDan Nelson8 Nov
    • Re: ROWIDPatrick Sherrill8 Nov