---
title: "Discussion on \"High Performance MySQL [Ch.5: Indexing for High Performance]\" | Hashnode"
description: "Discussion on \"High Performance MySQL [Ch.5: Indexing for High Performance]\". So the last article discussed chapter 4 of High Performance MySQL titled Optimizing Schema and Data Types. Today's article discusses chapter 5 titled Indexing for High Performance.\nIn the last chapter we discussed schema design choices and optimizati..."
url: "https://hashnode.com/posts/high-performance-mysql-ch5-indexing-for-high-performance/607ad6f3c99e200d08f7ae37"
---

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

Discussion

# [High Performance MySQL \[Ch.5: Indexing for High Performance\]](https://sayedalesawy.hashnode.dev/high-performance-mysql-ch5-indexing-for-high-performance?utm_source=hashnode&utm_medium=feed)

So the last article discussed chapter 4 of High Performance MySQL titled Optimizing Schema and Data Types. Today's article discusses chapter 5 titled Indexing for High Performance. In the last chapter we discussed schema design choices and optimizati...

Apr 17, 2021 · 29 min read · sayedalesawy.hashnode.dev  
Read the article

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

## Written by

[Sayed Alesawy](https://hashnode.com/@sayedalesawy)

@sayedalesawy · Cairo, Egypt

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

Lead Software Engineer @ Instabug

Lead Software Engineer at Instabug | Backend team. Passionate about large scale server side applications and distributed systems. Cairo University - Faculty of Engineering grad.

## Responses 5

Markdown supported · ⌘↵ to post

[Ahmed Ramadan](https://hashnode.com/@MrARA)

[Apr 30, 2025](https://hashnode.com/posts/high-performance-mysql-ch5-indexing-for-high-performance/607ad6f3c99e200d08f7ae37/comment/6812847f94da09e39f85448c)

Thank you for sharing. It had a significant impact on me, and I truly appreciate the effort and knowledge you put into it.

[Mostafa Mohamed](https://hashnode.com/@mostafao4o)

[Mar 17, 2025](https://hashnode.com/posts/high-performance-mysql-ch5-indexing-for-high-performance/607ad6f3c99e200d08f7ae37/comment/67d79f3ece7cf5258cb4224d)

SELECT ... WHERE date\_col >= DATE\_SUB(CURRENT\_DATE, INTERVAL 10 days); There is a subtlety in the new query that using an always changing value like CURRENT\_DATE although we don't need the entire date, just the days, will cause this query to miss the cache all the time. Is this argument still valid? as there is no query cache any more (by default at least)

[Abdelaziz](https://hashnode.com/@abdelaziz97)

[Nov 6, 2024](https://hashnode.com/posts/high-performance-mysql-ch5-indexing-for-high-performance/607ad6f3c99e200d08f7ae37/comment/672b6b0901070ab4ee57c5d0)

👏👏

[Mohab Yaser](https://hashnode.com/@mohabyaser0)

[Jul 3, 2024](https://hashnode.com/posts/high-performance-mysql-ch5-indexing-for-high-performance/607ad6f3c99e200d08f7ae37/comment/66859a8e3ca78ff712784e4d)

In the clustered indexes section, in the second paragraph, you said that that clustered means that the "whole table" is stored in the index leaf nodes, while in the third paragraph you said that the leaf nodes in the clustered index contain the entire "row", so which of them is true? Or you intended to say in the third paragraph that the leaf nodes have the row itself not a pointer to its position in disk?

[Sayed Alesawy](https://hashnode.com/@sayedalesawy)

[Jul 3, 2024](https://hashnode.com/posts/high-performance-mysql-ch5-indexing-for-high-performance/607ad6f3c99e200d08f7ae37/comment/66859a8e3ca78ff712784e4d#reply-6685cdc1abe2bd758732dddd)

I don’t see how they are contradicting? The entire table is in the clustered index and it’s stored as one row per leaf. Both statements are correct. And yes, for an innodb engine, there are no disk pointers.

Did that answer your concern?

[Mohab Yaser](https://hashnode.com/@mohabyaser0)

[Jul 7, 2024](https://hashnode.com/posts/high-performance-mysql-ch5-indexing-for-high-performance/607ad6f3c99e200d08f7ae37/comment/66859a8e3ca78ff712784e4d#reply-668ad4daf44da8ee45001a06)

Yeah, thank you.

[Abdelrahman Kefafy](https://hashnode.com/@abdelrahmanayyman)

[May 23, 2024](https://hashnode.com/posts/high-performance-mysql-ch5-indexing-for-high-performance/607ad6f3c99e200d08f7ae37/comment/664fb7c62c0b864bf373ceb5)

Match a leftmost prefix is quite not clear. Could you please explain it in a more clear way?

[Sayed Alesawy](https://hashnode.com/@sayedalesawy)

[May 23, 2024](https://hashnode.com/posts/high-performance-mysql-ch5-indexing-for-high-performance/607ad6f3c99e200d08f7ae37/comment/664fb7c62c0b864bf373ceb5#reply-664fbb68bf41a07a8f25ba14)

If we have a composite index like this idx(a,b,c). A leftmost prefix is a or ab or abc and so on. Any query pattern than can be covered by a leftmost prefix of the index can in fact utility this index. Is that more clear?

[Diaa Badr](https://hashnode.com/@diaabadr)

[Jun 2, 2023](https://hashnode.com/posts/high-performance-mysql-ch5-indexing-for-high-performance/607ad6f3c99e200d08f7ae37/comment/647a24b81c128bf71962a188)

It's really incredible. I can't find words to express how much I've enjoyed it.
