Currently queries like:
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.
Performance can be improved by doing the following:
- Rebuild the ancestor table
- Run VACUUM CONFANCESTORS; (or equivalent command if not using PostgreSQL)
- Create the index on the ancestorid column by using the following query (for PostgreSQL, should be similar for other databases):