Most RDBMS follow this rule:

Given Index (A,B,C), the following conditions will
allow the index to be considered..

Columns provided (Search Arguments):
A
A,B
A,B,C

The following combinations will not be allowed:

B
C
B,C

So as long as I provide the entire key or portions I
can use the index.  I would like the option to specify
how my tables are created.

--josef

--- Daniel Rall <[EMAIL PROTECTED]> wrote:
> josef richberg <[EMAIL PROTECTED]> writes:
> 
> > If I have a 3 column primary key (A,B,C), defined
> as
> > such:
> >   <column name ="A" primaryKey="true" .....>
> >   <column name ="B" primaryKey="true" .....>
> >   <column name ="C" primaryKey="true" .....>
> >
> > I get three indexes:
> > PRIMARY KEY(A,B,C)
> > INDEX (B,C)
> > INDEX (C)
> >
> > I don't need all three.
> 
> If you ever use less that all three PK columns in
> this join table, you
> will likely need all three.  For most RDBMSes, when
> you use only one
> or two of the PK columns, and they are not used in
> the same order
> defined in the PK declaration in the schema, you
> will not get the
> benefit of the indexing on those columns, and a full
> table scan will
> be performed (grossly inefficient).  This is
> mentioned in the
> documentation (see
> o.a.t.engine.database.model.Table#doHeavyIndex()).
> 
> I thought that there used to be a way to turn this
> behavior off, but
> don't see one on looking.  If for some reason you
> don't think you need
> this behavior, I'd commit a patch to the
> jakarta-turbine-torque
> repository which allows it to be turned off.
> 
> --
> To unsubscribe, e-mail:  
> <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail:
> <mailto:[EMAIL PROTECTED]>
> 


__________________________________________________
Do You Yahoo!?
Check out Yahoo! Shopping and Yahoo! Auctions for all of
your unique holiday gifts! Buy at http://shopping.yahoo.com
or bid at http://auctions.yahoo.com

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to