The confancestors table should have an index for lookups by ancestorid

XMLWordPrintable

      Problem

      Currently queries like:

      select DESCENDENTID from CONFANCESTORS where ANCESTORID = 589828;
      

      require a full table scan, because no index exists on the ancestorid column. On instances with a large number of confancestor entries, this can make various actions such as editing pages very slow.

      Workaround

      Performance can be improved by doing the following:

      1. Rebuild the ancestor table
      2. Run VACUUM CONFANCESTORS; (or equivalent command if not using PostgreSQL)
      3. Create the index on the ancestorid column by using the following query (for PostgreSQL, should be similar for other databases):
        CREATE INDEX confanc_ancestors ON CONFANCESTORS USING btree(ANCESTORID);
        

            Assignee:
            Niraj Bhawnani
            Reporter:
            Niraj Bhawnani
            Votes:
            2 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: