Hi,
I felt I should bring this to a discussion as I have reach a bottleneck with this issue.
I am testing this using drupal 6.8/cck 2.2/views 2.5 on a site with over 60 000 nodes. What i did is to just create a simple grid view, 20 items pager with 2 fields, node.title and user.picture, a node.post date sort and and node.Published filter.
This gives me a whopping Query execute time of ard 10133.26 ms!
Either removing node.title, node.post date sort, or node.Published filter will bring down the execute time to ard 600.00 ms, which the difference seems too great.
node.title seems to be the key issue here from a few other tests that I did. Below is a export of the view and hope that someone can test it on sites with large number of nodes and report the results here. Thanks!
$view = new view;
$view->name = 'viewtest';
$view->description = '';
$view->tag = '';
$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(
'title' => array(
'label' => 'Title',
'alter' => array(
'alter_text' => 0,
'text' => '',
'make_link' => 0,
'path' => '',
'alt' => '',
'prefix' => '',
'suffix' => '',
'help' => '',
'trim' => 0,
'max_length' => '',
'word_boundary' => 1,
'ellipsis' => 1,
'strip_tags' => 0,
'html' => 0,
),
'link_to_node' => 0,
'exclude' => 0,
'id' => 'title',
'table' => 'node',
'field' => 'title',
'override' => array(
'button' => 'Override',
),
'relationship' => 'none',
),
'name' => array(
'label' => 'Name',
'alter' => array(
'alter_text' => 0,
'text' => '',
'make_link' => 0,
'path' => '',
'alt' => '',
'prefix' => '',
'suffix' => '',
'help' => '',
'trim' => 0,
'max_length' => '',
'word_boundary' => 1,
'ellipsis' => 1,
'strip_tags' => 0,
'html' => 0,
),
'link_to_user' => 1,
'overwrite_anonymous' => 0,
'anonymous_text' => '',
'exclude' => 0,
'id' => 'name',
'table' => 'users',
'field' => 'name',
'override' => array(
'button' => 'Override',
),
'relationship' => 'none',
),
'picture' => array(
'label' => 'Picture',
'alter' => array(
'alter_text' => 0,
'text' => '',
'make_link' => 0,
'path' => '',
'alt' => '',
'prefix' => '',
'suffix' => '',
'help' => '',
'trim' => 0,
'max_length' => '',
'word_boundary' => 1,
'ellipsis' => 1,
'strip_tags' => 0,
'html' => 0,
),
'exclude' => 0,
'id' => 'picture',
'table' => 'users',
'field' => 'picture',
'override' => array(
'button' => 'Override',
),
'relationship' => 'none',
),
));
$handler->override_option('sorts', array(
'created' => array(
'order' => 'DESC',
'granularity' => 'second',
'id' => 'created',
'table' => 'node',
'field' => 'created',
'override' => array(
'button' => 'Override',
),
'relationship' => 'none',
),
));
$handler->override_option('filters', array(
'status' => array(
'operator' => '=',
'value' => '1',
'group' => '0',
'exposed' => FALSE,
'expose' => array(
'operator' => FALSE,
'label' => '',
),
'id' => 'status',
'table' => 'node',
'field' => 'status',
'override' => array(
'button' => 'Override',
),
'relationship' => 'none',
),
));
$handler->override_option('access', array(
'type' => 'none',
));
$handler->override_option('items_per_page', 20);
$handler->override_option('use_pager', '1');
$handler->override_option('style_plugin', 'grid');
$handler = $view->new_display('page', 'Page', 'page_1');
$handler->override_option('path', 'viewtest');
$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,
));
Comments
Comment #1
dawehnerdid you onece copied the resulting sql, for example you can get the query using devel query log.
Do you have installed any node access modules?
This can cause quite a big slow performance for many nodes. PS as only short help you could use panels and use the simple cache mechanism so this hard query only have to be runned some times
Comment #2
dropchew commentedHi dereine,
This is what i get from the above view,
Removing node.Published filter gives me this,
I do not have any node access modules installed...Not too sure how to get the query from devel log.
Comment #3
Shai commentedsubscribing
Comment #4
merlinofchaos commentedSeriously, what am I supposed to do about this? That's a perfectly simple query. Views can't write a query that performs better, and Views doesn't control the schema. So there's absolutely nothing Views can do here. As near as I can tell from your other bug reports, you've got a mysql install that performs like a dog. My best guess is that it's misconfigured but I'm not an expert in mysql configuration.
Comment #5
dropchew commentedHi merlin,
I don't think this is a bug from views either. (I did not set the status to bug report btw). Its tested on my test environment with xampp and production server (Lxadmin lighttpd) and both shows similar results. Maybe I should move this to the core issue and see if any other users have come across this. Sorry about that.
Comment #6
dropchew commentedComment #7
mdupontStill won't fix. There is not much to do from Drupal side.