Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Break index condition

435737Jul 31 2006 — edited Jul 31 2006
Hi friends,
reading Oracle documentation, I've seen the following about building indexes:

"The query can be rewritten using LIKE so that the indexed column is only on one side of the operator.

SELECT account_name, trans_date, amount
FROM transaction
WHERE account_name LIKE NVL(:acc_name, `%')
"

If I have an index on account_name column... I thinked that a LIKE in the where clause like this... would break the index... Is that correct?

Another question:

Is there any max number of columns recomended to build an index...?
(I have a table with 39 columns and I have an index for 6 columns.. )
I've read that the columns's order when we build the index could be important for tunning questions... any opinions?

Thanks.

Jose.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 28 2006
Added on Jul 31 2006
7 comments
551 views