At least the boost_cache_relationships table can easily grow quite large. The queries on this table then do queries that could be much more efficient. At the very least hash_url should be indexed. I added an index for hash_url, hash, timestamp so the whole routine query could be answered by the index but this may or may not be the most efficient index for all cases.

CommentFileSizeAuthor
#2 boost-661396.patch1.94 KBmikeytown2
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

mikeytown2’s picture

Category: feature » bug

Shoot, thought I did that. Thanks for bringing this up. Indexes should be created on
hash
base_dir
page_callback
page_type
page_id
child_page_callback
child_page_type
child_page_id
hash_url
timestamp
Since these are the fields I use when doing a lookup... looks like I use them all. WHERE and ORDER BY statements.

boost_cache_expire_router()
        db_query("DELETE FROM {boost_cache_relationships} WHERE base_dir = '%s' AND page_callback = '%s' AND page_type = '%s' AND page_id = '%s'", $dblookup['base_dir'], $dblookup['page_callback'], $dblookup['page_type'], $dblookup['page_id']);


boost_cache_get_node_relationships()
      $result = db_query("SELECT page_callback, page_type, page_id, base_dir FROM {boost_cache_relationships} WHERE child_page_id = '%s' AND child_page_type = '%s' AND child_page_callback = '%s' AND base_dir = '%s'", $data['page_id'], $data['page_type'], $data['page_callback'], $data['base_dir']);


boost_cache_prune_node_relationship()
  $result = db_query("SELECT hash, timestamp FROM {boost_cache_relationships} WHERE hash_url = '%s' ORDER BY timestamp DESC", $hash_url);
      db_query("DELETE FROM {boost_cache_relationships} WHERE hash = '%s'", $info['hash']);
mikeytown2’s picture

Status: Active » Needs review
FileSize
1.94 KB
mikeytown2’s picture

Status: Needs review » Fixed

committed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.