Improving Query Performance Without Hacking Core

Track: 
Coder
Experience: 
Intermediate

The Drupal database structure and highly-customizable field system make for great sites, but can also cause a problem with poorly constructed queries. As your site grows, queries that perform well one day may not the next due to additional features or an influx of content.

This session will cover how to identify if you have a problem with your queries and what tools are available to help you. We'll look at some common query problems and how to solve them, and cover some common Drupal queries that can run slow. We'll also give an overview of reading the query execution plan ( focusing on mysql and postgres ) and how to use that knowledge to identify solutions for better query performance.

We'll then look at the changes in the query system from D6 to D7 with a specific focus on the changes that affect your ability to alter queries. We'll take a look at how to use Drupal 7's new DBTNG system to modify core and views queries for performance, add filters to queries, send queries to slave servers, or otherwise alter the query object.

We'll look at a few real-world queries, and how you can improve them dramatically with just a few lines of code.

Intended audience: 

Drupal developers of all experience levels, especially developers of medium-to-high traffic sites or sites with a large quantity of content. Attendees will learn where to look to find problem queries, how to identify and solve common query problems, and how to take that knowledge and apply it to your Drupal site.

Questions answered by this session
Question 1: 
How to find queries that may be responsible for site crashes.
Question 2: 
How to read an execution plan and what are some things to fix if they show up.
Question 3: 
What are some views configurations that can result in poor performance, and how can I make them perform better?
Question 4: 
What are the differences between modifying queries in D6 and D7.
Question 5: 
How can I use the DBTNG system to alter a query?
4.35
Your rating: None Average: 4.4 (40 votes)

Diamond Sponsors

 
VPS NET
Palantir.net

Platinum sponsors

 
Trellon
workhabit

Gold Sponsors

 
Microsoft
HotDrupal.com
Duo
Drupal Connect
Chapter Three
Treehouse Agency
NorthPoint