> table sidea (a_id)
> table sideb (b_id)
> table a_to_b (a_id references sidea on delete cascade, b_id references
> sideb on delete cascade)
>
> a_to_b is unique, so: create unique index idx ON a_to_b (a_id, b_id)
I'd add a 2nd index: create index on a_to_b(b_id).
This should be sufficient for most uses. Certainly an additional index
on only (a_id) would be redundant.
--
Josh Berkus
PostgreSQL Experts Inc.
http://pgexperts.com