Llayland’s Food, Oracle, and Haskell

June 14, 2012

Quiz: index including a constant

Filed under: Oracle — llayland @ 3:28 pm

I was surprised when i tried to create an index like this and it actually worked:

Create index t1idx on t1(n1,1);

The question is: Why would you want to do this?

There is at least one valid use case.

2 Comments »

  1. The index will include entries even when n1 is null.

    Comment by Jeffrey Kemp — June 25, 2012 @ 4:08 am

  2. Spot on. Thanks for answering.

    Restating to take one more shot at a pervasive myth: “where n1 is null” can use the index.

    Comment by llayland — June 27, 2012 @ 2:19 am


RSS feed for comments on this post. TrackBack URI

Leave a comment

Blog at WordPress.com.