Hello,

just small question.
I just realized that it seems that Oracle stores indexed values in the index 
itself. This mean that it is not necessary to access table when you need to 
get only indexed values.

iso table has an index for vin field. Here is an output for different queries.

SQL> explain plan for select * from iso where vin='dfgdfgdhf';
 
Explained.
 
SQL> @?/rdbms/admin/utlxpls
 
Plan Table
--------------------------------------------------------------------------------
| Operation                 |  Name    |  Rows | Bytes|  Cost  | Pstart| 
Pstop |
--------------------------------------------------------------------------------
| SELECT STATEMENT          |          |     6 |  402 |      8 |       |      
 |
|  TABLE ACCESS BY INDEX ROW|ISO       |     6 |  402 |      8 |       |      
 |
|   INDEX RANGE SCAN        |IX_ISO_VI |     6 |      |      3 |       |      
 |
--------------------------------------------------------------------------------
 
6 rows selected.
 
SQL> explain plan for select vin from iso where vin='dfgdfgdhf';
 
Explained.
 
SQL> @?/rdbms/admin/utlxpls
 
Plan Table
--------------------------------------------------------------------------------
| Operation                 |  Name    |  Rows | Bytes|  Cost  | Pstart| 
Pstop |
--------------------------------------------------------------------------------
| SELECT STATEMENT          |          |     6 |   42 |      3 |       |      
 |
|  INDEX RANGE SCAN         |IX_ISO_VI |     6 |   42 |      3 |       |      
 |
--------------------------------------------------------------------------------


I think this question already was raised here, but... Why PostgreSQL does not 
do this? What are the pros, and contros?

-- 
Sincerely Yours,
Denis Perchine

----------------------------------
E-Mail: [EMAIL PROTECTED]
HomePage: http://www.perchine.com/dyp/
FidoNet: 2:5000/120.5
----------------------------------

Reply via email to