In relativity.install (HEAD version: 1.3 2007/07/04 14:59:26), the install function does

      db_query("CREATE TABLE {relativity} (
        ...
        KEY nid (nid),
        KEY parent_nid (nid)
        ) ...;

This means that on a clean install, we get 2 indexes on column nid (called "nid" and "parent_nid"), but no index on parent_nid, which was what was intended. Nothing breaks, it just means relativity queries will be slower than they should be.

The attached patch should correct this problem.

Note that update 2 does

  $items[] = update_sql("ALTER TABLE relativity DROP INDEX parent_nid,
                         ADD INDEX parent_nid (parent_nid)");

so if you had an old install (before update 2) and ran update, you end up with the correct index.

So to make sure people who have already installed (with update 2 included), the attached patch includes an "update 3" to re-apply the fix to parent_nid for people would would have done a clean install after update 2.

I have tested the SQL only, since I don't have Drupal 5 or 6 running at present. To correctly review and test this patch, it would need to be checked on both (1) a clean install, and also (2) an upgrade from a post-update-2 installation.

This issue looks like it also applies to the 4.7 and 5 branches. (Since the install script hasn't changed much, the attached patch may even apply directly.)

Mark

CommentFileSizeAuthor
relativity.install.patch1.14 KBplumbley