Hello,

Views is an excellent tool, but I'm wondering if it's not the right tool for my particular task. Here is a summary of my issue:

What do I mean by large query?

The query I'm working on so far has 12 LEFT JOINs and 20 lines (when I copy it into SqlYog). And I'm not done.

Is the query slow?

No.

Query build time = 13.3 ms

Query execute time = 8.53 ms

View render time = 153.69 ms

Then what's the issue?

I would just like some rough parameters to guide me so I know when to say, ok, this query is getting too big. I need to change course.

What am I trying to do?

I'm creating a hierarchy tree of nodes using Views and the Views Tree module. The complexity comes in because each node can take different forms (e.g. an organization type with one set of fields, a different organization type with a different set of fields, an employee type with yet a different set of fields). I'm converting some web pages into Drupal.

Question (Finally):

Is Views the right tool for this job? Or should I really be using php to generate the html for this tree?

Thank you,
Ann

Comments

renatog’s picture

Hi Ann how are you?

Is the right tool for this job?

Yes, you can do it using views.

In some cases it may seem faster to use SQL directly, however using Views has many advantages. (For example, use CMS to edit your query)

To improve your performance I recommend that you upgrade to the latest version of Drupal core and views, and then make a backup and run update.php.

If it continues slow, I recommend doing the query in steps, that is, doing one join at a time, for we find out when it becomes heavier and so we think about improving performance. For example; Simplifying the nodes or something.

renatog’s picture

Status: Active » Fixed

Any question about it please, feels free to comment.

Best.

Status: Fixed » Closed (fixed)

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