Re: Separate Index or Composite Indice ?



"userjohn" <userjohn@xxxxxxxxxxxxxx> wrote:
10gR2

If you have :
2 columns on a hi-traffic transactional table
- one ("some_id") high cardinality
- and one ("yes_no") low cardinality

You use both columns in SQL - "some_id" is used in JOIN and "yes_no" as a
predicate

In the same SQL, or in separate SQLs?

Would you create normal index on BOTH , just "some_id" or a composite
indice on "some_id" + "yes_no" ?

I generally wouldn't bother with a single column index on "yes_no".
I'd make one on (some_id,yes_no) and forget it. If it forces itself
back into your attention due to performance issues, then I'd look
at explain plans.

Xho

--
-------------------- http://NewsReader.Com/ --------------------
Usenet Newsgroup Service $9.95/Month 30GB
.



Relevant Pages

  • Re: Separate Index or Composite Indice ?
    ... as a predicate ... In the same SQL, or in separate SQLs? ... I think it's more a matter of the histogram than the clustering factor. ... The clustering factor could be very good even in a two value column if you sort the table by the value. ...
    (comp.databases.oracle.server)
  • Re: Separate Index or Composite Indice ?
    ... Jan Krueger wrote: ... as a predicate ... In the same SQL, or in separate SQLs? ... against using the index at all, no matter which way around it is. ...
    (comp.databases.oracle.server)