After I upgraded from views 6.x-2.6 to 2.7, I felt a view significantly slower. To confirm, I just did some benchmarking.

This particular view in 2.6 is making 66 queries. In 2.7 it is making 130 queries (almost double). NO other change other than views upgrade. When I started benchmarking I made sure to clear view cache as well as clearing other data cache. Majority of additional queries are coming from several new og_get_node_groups_result and drupal_lookup_path queries. There are few new queries like pre_render and render_textarea which takes up some time but those are few in number.

I also did benchmarking of my frontpage which has several panels. And surprisingly there is no difference at all between 2.6 and 2.7 version (both 66 queries). So this seems to be affecting only some views.

So as far as I know it is affecting this view which comes by default as OG tracker view (OG 6.x-2.0). I don't know if more views are affected.

$view = new view;
$view->name = 'og_tracker';
$view->description = 'Shows active posts across the whole site.';
$view->tag = 'og';
$view->view_php = '';
$view->base_table = 'node';
$view->is_cacheable = FALSE;
$view->api_version = 2;
$view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */
$handler = $view->new_display('default', 'Defaults', 'default');
$handler->override_option('fields', array(
  'tid' => array(
    'label' => 'All terms',
    'alter' => array(
      'alter_text' => 0,
      'text' => '',
      'make_link' => 0,
      'path' => '',
      'link_class' => '',
      'alt' => '',
      'prefix' => '',
      'suffix' => '',
      'help' => '',
      'trim' => 0,
      'max_length' => '',
      'word_boundary' => 1,
      'ellipsis' => 1,
      'strip_tags' => 0,
      'html' => 0,
    ),
    'type' => 'separator',
    'separator' => ', ',
    'empty' => '',
    'link_to_taxonomy' => 0,
    'limit' => 1,
    'vids' => array(
      '9' => 9,
      '10' => 0,
      '7' => 0,
      '5' => 0,
      '8' => 0,
      '1' => 0,
      '4' => 0,
      '6' => 0,
      '11' => 0,
      '2' => 0,
      '3' => 0,
      '12' => 0,
      '14' => 0,
    ),
    'exclude' => 0,
    'id' => 'tid',
    'table' => 'term_node',
    'field' => 'tid',
    'relationship' => 'none',
  ),
  'title' => array(
    'id' => 'title',
    'table' => 'node',
    'field' => 'title',
    'label' => 'Title',
    'relationship' => 'none',
    'link_to_node' => 1,
  ),
  'name' => array(
    'label' => 'लेखक',
    'alter' => array(
      'alter_text' => 0,
      'text' => '',
      'make_link' => 0,
      'path' => '',
      'link_class' => '',
      'alt' => '',
      'prefix' => '',
      'suffix' => '',
      'help' => '',
      'trim' => 0,
      'max_length' => '',
      'word_boundary' => 1,
      'ellipsis' => 1,
      'strip_tags' => 0,
      'html' => 0,
    ),
    'link_to_user' => 0,
    'overwrite_anonymous' => 0,
    'anonymous_text' => '',
    'exclude' => 0,
    'id' => 'name',
    'table' => 'users',
    'field' => 'name',
    'relationship' => 'none',
  ),
  'comment_count' => array(
    'id' => 'comment_count',
    'table' => 'node_comment_statistics',
    'field' => 'comment_count',
    'label' => 'Replies',
    'set_precision' => FALSE,
    'precision' => 0,
    'decimal' => '.',
    'separator' => ',',
    'prefix' => '',
    'suffix' => '',
    'relationship' => 'none',
  ),
  'group_nid' => array(
    'id' => 'group_nid',
    'table' => 'og_ancestry',
    'field' => 'group_nid',
    'label' => 'Groups',
    'type' => 'separator',
    'separator' => ', ',
    'empty' => '',
    'relationship' => 'none',
  ),
  'last_comment_timestamp' => array(
    'id' => 'last_comment_timestamp',
    'table' => 'node_comment_statistics',
    'field' => 'last_comment_timestamp',
    'label' => 'Last post',
    'date_format' => 'small',
    'custom_date_format' => '',
    'relationship' => 'none',
  ),
  'timestamp' => array(
    'id' => 'timestamp',
    'table' => 'history_user',
    'field' => 'timestamp',
    'label' => '',
    'comments' => 1,
    'relationship' => 'none',
    'link_to_node' => 0,
  ),
  'new_comments' => array(
    'id' => 'new_comments',
    'table' => 'node',
    'field' => 'new_comments',
    'label' => '',
    'set_precision' => FALSE,
    'precision' => 0,
    'decimal' => '.',
    'separator' => ',',
    'prefix' => '',
    'suffix' => 'new',
    'link_to_comment' => 1,
    'no_empty' => 1,
    'relationship' => 'none',
  ),
));
$handler->override_option('sorts', array(
  'last_comment_timestamp' => array(
    'id' => 'last_comment_timestamp',
    'table' => 'node_comment_statistics',
    'field' => 'last_comment_timestamp',
    'order' => 'DESC',
    'granularity' => 'second',
    'relationship' => 'none',
  ),
));
$handler->override_option('filters', array(
  'status' => array(
    'id' => 'status',
    'table' => 'node',
    'field' => 'status',
    'operator' => '=',
    'value' => 1,
    'group' => 0,
    'exposed' => FALSE,
    'expose' => array(
      'operator' => FALSE,
      'label' => '',
    ),
    'relationship' => 'none',
    'expose_button' => array(
      'button' => 'Expose',
    ),
  ),
));
$handler->override_option('access', array(
  'type' => 'none',
));
$handler->override_option('cache', array(
  'type' => 'time',
  'results_lifespan' => '300',
  'output_lifespan' => '-1',
));
$handler->override_option('title', 'संपूर्ण मायबोलीवरचं नवीन लेखन');
$handler->override_option('header', '<a href="http://kharedi.maayboli.com/shop/home.php?cat=283&whatsnew"><strong><red>२००९ दिवाळी अंकांची विक्री सुरू झाली आहे. त्वरीत आपली मागणी नोंदवा.</red></strong></a>');
$handler->override_option('header_format', '3');
$handler->override_option('header_empty', 0);
$handler->override_option('items_per_page', 25);
$handler->override_option('use_pager', '1');
$handler->override_option('distinct', 0);
$handler->override_option('style_plugin', 'table');
$handler->override_option('style_options', array(
  'override' => 1,
  'order' => 'desc',
  'columns' => array(
    'type' => 'type',
    'title' => 'title',
    'name' => 'name',
    'comment_count' => 'comment_count',
    'group_nid' => 'group_nid',
    'last_comment_timestamp' => 'last_comment_timestamp',
    'timestamp' => 'title',
    'new_comments' => 'comment_count',
  ),
  'info' => array(
    'type' => array(
      'sortable' => 1,
      'separator' => '',
    ),
    'title' => array(
      'sortable' => 1,
      'separator' => '&nbsp;',
    ),
    'name' => array(
      'sortable' => 1,
      'separator' => '',
    ),
    'comment_count' => array(
      'sortable' => 1,
      'separator' => '<br />',
    ),
    'group_nid' => array(
      'separator' => '',
    ),
    'last_comment_timestamp' => array(
      'sortable' => 1,
      'separator' => '&nbsp;',
    ),
    'timestamp' => array(
      'separator' => '',
    ),
    'new_comments' => array(
      'separator' => '',
    ),
  ),
  'default' => 'last_comment_timestamp',
));
$handler = $view->new_display('page', 'Page', 'page');
$handler->override_option('path', 'group/tracker');
$handler->override_option('menu', array(
  'type' => 'tab',
  'title' => 'Recent posts',
  'description' => '',
  'weight' => '5',
  'name' => 'navigation',
));
$handler->override_option('tab_options', array(
  'type' => 'none',
  'title' => '',
  'description' => '',
  'weight' => 0,
));
$handler = $view->new_display('feed', 'Feed', 'feed');
$handler->override_option('style_plugin', 'rss');
$handler->override_option('style_options', array(
  'mission_description' => FALSE,
  'description' => '',
));
$handler->override_option('row_plugin', 'node_rss');
$handler->override_option('row_options', array(
  'item_length' => 'default',
));
$handler->override_option('path', 'group/tracker/feed');
$handler->override_option('menu', array(
  'type' => 'none',
  'title' => '',
  'description' => '',
  'weight' => 0,
  'name' => 'navigation',
));
$handler->override_option('tab_options', array(
  'type' => 'none',
  'title' => '',
  'description' => '',
  'weight' => 0,
));
$handler->override_option('displays', array(
  'page' => 'page',
  'default' => 0,
));
$handler->override_option('sitename_title', FALSE);

Comments

ajayg’s picture

This particular view in 2.6 is making 66 queries. In 2.7 it is making 130 queries (almost double). 

I should have said
This particular page which has OG tracker view, in 2.6 is making 66 queries. In 2.7 it is making 130 queries (almost double).

No other changes on that page (or any other page) other than views upgrade to 2.7

ajayg’s picture

No one else noticed this?

merlinofchaos’s picture

Category: bug » support

I haven't seen anything in Views that would do this. Extra queries that happen when a View is run have more to do with individual fields and styles, and there's no easy way to tell from this where those queries might be coming from. Views itself doesn't run anywhere near that many queries itself, but lots of Drupal functions might, depending upon what you are displaying.

esmerel’s picture

Status: Active » Closed (fixed)

Given the age of the request, I have to assume this is no longer an issue.