added per-thread caching for "static" sitenotes. In case these will change (never saw a system where this happend), either a broadcast flush or a restart is needed.
Added index on foreign key column to reduce sequential reads on deleteoperations, since the optimizer brain fart ((c)Don Baccus) that existed17 years ago in pg 7.2 seems to be gone(https://openacs.org/forums/message-view?message_id=142769)