Re: question about index

  • From: "Mark Brinsmead" <pythianbrinsmead@xxxxxxxxx>
  • To: TESTAJ3@xxxxxxxxxxxxxx
  • Date: Mon, 19 May 2008 20:56:56 -0600

Your confusion is understandable.

The problem, I think, is that "Function Based Index" is an unfortunate
misnomer.  If Oracle had called this an "Expression Based Index"
(which is what it really is), these would probably be much more
intuitive.

'X1' is an expression with a constant value.  If you build an
"Expression Based Index" on this expression, what would you expect to
get?  :-)

I'm pretty sure that there is no way you will ever be able to get the
CBO to use this index for any purpose.  Well, except maybe something
like:
      SELECT COUNT('X1') FROM Z1;
or perhaps one or two other similarly useless queries.  :-)

On 5/19/08, TESTAJ3@xxxxxxxxxxxxxx <TESTAJ3@xxxxxxxxxxxxxx> wrote:
> thats what was confusing me, if it had a function involved, i'd understand
> but this just seems stupid to me :)
>
> joe
>
> ---------------------------------------
> You can have it: Fast, Right or Cheap, pick 2 of the 3.
> Fast + Right is Expensive
> Fast + Cheap will be incorrect.
> Right + Cheap will take a while.
>
>
>
> "Terrian, Thomas J Mr CTR DLA J6DIB" <Tom.Terrian.ctr@xxxxxxx>
>
>
>
>
>
> 05/19/2008 02:39 PM
>
> From
> "Terrian, Thomas J Mr CTR DLA J6DIB" <Tom.Terrian.ctr@xxxxxxx>
> To
> <TESTAJ3@xxxxxxxxxxxxxx>, <oracle-l@xxxxxxxxxxxxx>
> cc
>
> Subject
> RE: question about index
>
>
>
>
>
>
> Function based index......but I am not sure how you would use it.
>
> -----Original Message-----
> From: oracle-l-bounce@xxxxxxxxxxxxx
> [mailto:oracle-l-bounce@xxxxxxxxxxxxx] On Behalf Of
> TESTAJ3@xxxxxxxxxxxxxx
> Sent: Monday, May 19, 2008 1:55 PM
> To: oracle-l@xxxxxxxxxxxxx
> Subject: question about index
>
>
> Ok i guess i'm having a brain fart, someone asked me about this and for
> the life of me i can't figure it out.  The 2nd index, what exactly is it
> doing with single quotes around the column name??
>
> SQL> create table z1(x1 number, x2 date);
>
> Table created.
>
> SQL> CREATE INDEX X1 ON Z1 (X1);
>
> Index created.
>
> SQL> CREATE INDEX X2 ON Z1 ('X1');
>
> Index created.
>
>
> Thanks,  Joe
>
> ---------------------------------------
> You can have it: Fast, Right or Cheap, pick 2 of the 3.
> Fast + Right is Expensive
> Fast + Cheap will be incorrect.
> Right + Cheap will take a while.
>
>
>


-- 
Cheers,
-- Mark Brinsmead
   Senior DBA,
   The Pythian Group
   http://www.pythian.com/blogs
--
//www.freelists.org/webpage/oracle-l


Other related posts: