Hi,
I'm trying to build a (very simple) view which is supposed to return a page (view type: table view). It's supposed to display images provided by Amazon, side by side with the "real" images for certain products (which often don't match). The view is filtered by a node reference field and includes a "Node: Published" filter as recommended; neither arguments nor sort criteria are given in this stripped version. It references to a set of approximately 300 nodes; the whole site contains about 30.000 nodes.
As soon as the view is executed, the MySQL starts spawning an increasing number of threads and queries; after a few minutes, the site becomes inaccessible, this continues for about ten minutes, then MySQL dies. No output is given in this time.
Samples for the queries:
SELECT n.nid, n.rating, a.* FROM amazonnode n JOIN amazonitem a ON a.asin = n.asin WHERE ntype = 'amazon' LIMIT 1 OFFSET 214
SELECT count(node.nid) FROM node node LEFT JOIN image_attach image_attach ON node.nid = image_attach.nid LEFT JOIN amazonnode amazonnode ON node.nid = amazonnode.nid LEFT JOIN amazonitem amazonitem ON amazonnode.asin = amazonitem.asin LEFT JOIN content_type_ausgabe node_data_field_seriennummer_integer ON node.vid = node_data_field_seriennummer_integer.vid LEFT JOIN content_type_ausgabe node_data_field_artikelnummer ON node.vid = node_data_field_artikelnummer.vid LEFT JOIN content_type_ausgabe node_data_field_isbn ON node.vid = node_data_field_isbn.vid LEFT JOIN content_type_ausgabe node_data_field_erscheinungsdatum ON node.vid = node_data_field_erscheinungsdatum.vid
It is impossible to "stop" executing the view or defining a "timeout" (like "if running for more than 30 seconds stop what you're doing"). I'm considering this a critical bug since running a view IMHO must not kill a complete website. Atr least in my setup, this is reproducable.
To get the server running again, I've to restart mysqld (/etc/init.de/mysql start), or - if the queries have eaten too many system ressources - or reboot the server.
Involved in this configuration are Drupal core nodes, Amazontools ASINs, Image module's Image nodes, and CCK fields (Node Reference, Text, Number, and Date).
Any ideas what's going wrong?
System information: Drupal 5.9; Apache 2.2.3; PHP 5.2.0-8+etch11; MySQL 5.0.32; Debian GNU/Linux "Etch"
Thanks & greetings, -asb
| Comment | File | Size | Author |
|---|---|---|---|
| views.export.txt | 3.66 KB | asb |
Comments
Comment #1
merlinofchaos commentedViews can't be held responsible for MySQL crashing.
Being a query builder, yes, Views allows you to create inefficient queries. It has no mechanism to stop that, nor is such a mechanism even possible as the intelligence necessary to even make guesses at what is inefficient and what is not simply is not there.
If you have views that create inefficient queries that cause MySQL problems, then you need to refactor your views or not use them.
Your view is using data almost exclusively from modules; I don't know much about this data. Your best bet is to use mysql's EXPLAIN on the queries in question and see what comes up. Maybe the amazon module needs some tweaking to store its data more sanely so that this kind of thing doesn't happen. But there is pretty much nothing Views can do about this.