From: | Jayadevan M <Jayadevan(dot)Maymala(at)ibsplc(dot)com> |
---|---|
To: | John R Pierce <pierce(at)hogranch(dot)com> |
Cc: | pgsql-general(at)postgresql(dot)org, pgsql-general-owner(at)postgresql(dot)org |
Subject: | Re: Doubts about oid |
Date: | 2010-02-19 04:31:34 |
Message-ID: | OFFDD503B5.841F48F8-ON652576CF.001855F9-652576CF.0018E111@ibsplc.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
Hi,
> Even in Oracle, I don't believe rowid bypasses
> indexes, its more like an implicit SERIAL PRIMARY KEY field.
Well, I understand the point is not very relevant, since oid is not
similar to rowid. In Oracle, index scans are bypassed if we use rowid.
1)Access by unique index
SQL> select * from myt where id=200;
Execution Plan
----------------------------------------------------------
Plan hash value: 1325982734
--------------------------------------------------------------------------------
----
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)|
Time
|
--------------------------------------------------------------------------------
----
| 0 | SELECT STATEMENT | | 1 | 65 | 1 (0)|
00:00:
01 |
| 1 | TABLE ACCESS BY INDEX ROWID| MYT | 1 | 65 | 1 (0)|
00:00:
01 |
|* 2 | INDEX UNIQUE SCAN | MYDX | 1 | | 1 (0)|
00:00:
01 |
--------------------------------------------------------------------------------
2) Access by rowid
SQL> select * from myt where rowid='AAAH9iAAEAAAAafADH';
ID
----------
NAME
--------------------------------------------------------------------------------
200
REFCON$
Execution Plan
----------------------------------------------------------
Plan hash value: 4204525950
--------------------------------------------------------------------------------
---
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)|
Time
|
--------------------------------------------------------------------------------
---
| 0 | SELECT STATEMENT | | 1 | 77 | 1 (0)|
00:00:0
1 |
| 1 | TABLE ACCESS BY USER ROWID| MYT | 1 | 77 | 1 (0)|
00:00:0
Regards,
Jayadevan
DISCLAIMER:
"The information in this e-mail and any attachment is intended only for
the person to whom it is addressed and may contain confidential and/or
privileged material. If you have received this e-mail in error, kindly
contact the sender and destroy all copies of the original communication.
IBS makes no warranty, express or implied, nor guarantees the accuracy,
adequacy or completeness of the information contained in this email or any
attachment and is not liable for any errors, defects, omissions, viruses
or for resultant loss or damage, if any, direct or indirect."
From | Date | Subject | |
---|---|---|---|
Next Message | Tom Lane | 2010-02-19 05:07:42 | Re: GROUP BY column alias? |
Previous Message | John R Pierce | 2010-02-19 04:11:46 | Re: Doubts about oid |