by mauritsl: Reprocess index operations in cron to ensure that the shadow tables are updated correctly.
by mauritsl: Include fields in primary key if their joins can result in multiple rows per row in the base table.