---
title: "Discussion on \"The 3-Second MySQL Query That Was Fixed by One Composite Index\" | Hashnode"
description: "Discussion on \"The 3-Second MySQL Query That Was Fixed by One Composite Index\". A user page in our app took three seconds to load. Not the whole app — one page, one query. The query looked harmless:\nSELECT * FROM orders\nWHERE user_id = 1234\nORDER BY created_at DESC\nLIMIT 20;\n\nTwe"
url: "https://hashnode.com/posts/the-3-second-mysql-query-that-was-fixed-by-one-composite-index/6b03caea3f73a408c33f0461"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [The 3-Second MySQL Query That Was Fixed by One Composite Index](https://rajadevsolutions.hashnode.dev/the-3-second-mysql-query-that-was-fixed-by-one-composite-index?utm_source=hashnode&utm_medium=feed)

A user page in our app took three seconds to load. Not the whole app — one page, one query. The query looked harmless: SELECT \* FROM orders WHERE user\_id = 1234 ORDER BY created\_at DESC LIMIT 20; Twe

19h ago · 3 min read · rajadevsolutions.hashnode.dev  
Read the article

-   [#mysql](https://hashnode.com/tag/mysql)
-   [#databases](https://hashnode.com/tag/databases)
-   [#performance](https://hashnode.com/tag/performance)

## Written by

[Raja Hunain](https://hashnode.com/@rajadevsolutions)

@rajadevsolutions

  
[View profile](https://hashnode.com/@rajadevsolutions)

Full Stack Developer — PHP, Laravel, MySQL, JavaScript. I write practical coding solutions at rajadevsolutions.online

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
