Forum OpenACS Development: Response to OpenACS 4.0 Guidelines (aD questions)

Collapse
Posted by Don Baccus on
Hmmm...but the code isn't taking advantage of this.  The only place
the constraint is disabled then reenabled is when
acs-objects-create.sql is run.

I suppose someone may've thought it would be useful for cases where
you copy in tons of data directly into the objects table.  In this
case, though, the cost of dropping and rebuilding the index isn't
really that big a deal.

The code certainly doesn't hurt, but unless the ACS were to start
disabling and reenabling the unique constraint on a frequent basis it
doesn't help, either.

It may actually slow things down a bit.  When a unique index is used
to enforce the constraint, Oracle can throw a constraint error based
on whether or not the insertion into the index succeeds.  Using a
non-unique index to enforce the constraint means that the check has to
be done on the index after insertion.  Of course, the insertion code
may flag dupe entries anyway specifically to optimize this case.  But
then again it may not.