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]>

Reply via email to