# Drupal Performance Tip – 'I’m too young to die' – indexes and SQLs — Liran Tal

This entry is part 1 of 2 in the series Drupal Performance Tips

Canonical: https://lirantal.com/blog/2014-11-05

![Cover artwork for Drupal Performance Tip – 'I’m too young to die' – indexes and SQLs](/_astro/photo-1468956398224-6d6f66e22c35.BePqp3CW_Zj88Tk.jpg)

*In the spirit of the computer video game [Doom](http://doom.wikia.com/wiki/Doom) and its [skill levels](http://doom.wikia.com/wiki/Skill_level), we’ll review a few ways you can improve your [Drupal](http://drupal.org/) speed performance and optimize for better results and server response time. These tips that we’ll cover may be at times specific to Drupal 6 versions, although you can always learn the best practices from these examples and apply them on your own code base.*

![Doom](https://web.archive.org/web/20141117232040im_/http://adamatomic.com/pics/blog/doom/doom2.jpg)

**Using indexes**, and **proper SQL queries** can boost performance by a huge factor, especially if the affected tables are very big (millions of rows). Take a look at the diff below showing a fix to a not so proper, and ill-advised use of querying the database:

[![drupal\_perf-1](https://web.archive.org/web/20141117232040im_/http://enginx.com/wp-content/uploads/2014/11/drupal_perf-1.png)](http://enginx.com/wp-content/uploads/2014/11/drupal_perf-1.png)

The bad performing query took anything between 6 to 60 seconds to run, depending on the data, and database load, and database’s current cache state. The newer query takes milliseconds.

## More writing

[All writing](/blog)

*   Sep 5, 2026

    ### [Self-Hosting Hermes Agent with Matrix E2EE on Proxmox](/blog/self-host-hermes-agent-matrix-e2ee-proxmox)

*   Aug 2, 2026

    ### [The Practical Second Brain: Building an LLM-Operated Markdown Knowledge Graph](/blog/practical-second-brain-llm-markdown-knowledge-graph)

*   Aug 1, 2026

    ### [Building a Second Brain with LLMs and AI Agents](/blog/building-second-brain-llms-ai-agents)


* * *

Liran Tal is the author of the book [Node.js Secure Coding: Defending Against Command Injection Vulnerabilities](https://www.nodejs-security.com/)

[Start Building Secure Node.js Applications](https://www.nodejs-security.com/)

 [![](/_astro/nodejs-secure-coding-book-3d-style.DiTWpzFs_Z3c7s1.png)](https://www.nodejs-security.com/)
