Skip to content

Commit 95a91f2

Browse files
Dark mode
1 parent 3ccddc6 commit 95a91f2

14 files changed

Lines changed: 91 additions & 92 deletions

content/archive.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ h1 {margin:0.5rem 0;}
3333
</style>
3434

3535
<div class="left-icon" style="border: 3px solid hotpink; border-radius: 15px; padding:1rem;">
36-
<img class="ion" src="/img/ionicons/alert-circle-outline.svg">
36+
<div style="margin-right: 1rem">{{< alert-icon >}}</div>
3737
Redirected from another link?
3838
That link points to something archived.
3939
Rather than leaving you stranded on a 404 page, this archive provides alternatives.</p>

content/book-2.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -178,13 +178,13 @@ Instead, sort (1) init time includes both index range scan (0) read time and tim
178178
Since index range scan (0) read time is only time spent fetching rows, we can subtract it from sort (1) init time to roughly calculate time spent sorting rows: 2043.416 &minus; 1996.350 &equals; 47 ms.
179179
180180
<div class="note warn left-icon">
181-
<img class="ion" src="/img/ionicons/warning-outline.svg">
182-
<p>
181+
<div>{{< warning-icon >}}</div>
182+
<div>
183183
Alas, the aforementioned means that my original explanation on page 70 of <a href="https://oreil.ly/efficient-mysql-performance"><i>Efficient MySQL Performance</i></a> is not accurate.
184184
I wrote that "the filesort (line 1) started after [2043.416] milliseconds and ended after [2051.792] milliseconds, which means the filesort took 8 milliseconds."
185185
The conclusion is still correct: "The answer is no: filesort does not make this query slow. The problem is data access: 68,439 rows is not a small result set."
186186
But how I arrived at the conclusion was incorrect.
187-
</p>
187+
</div>
188188
</div>
189189
190190
The moral of the story is: sometimes you need to understand how iterators work under the hood (in the MySQL source code) in order to correctly interpret the reported timing values.

content/infamous-order-by-limit-query-optimizer-bug.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -370,15 +370,15 @@ If you win, nothing will happen; performance will stay the same.
370370
If you lose, you can quickly re-enable it, or use `FORCE INDEX` to force the secondary index (use `EXPLAIN` to see what it is before MySQL changes the plan).
371371
372372
<div class="note warn left-icon">
373-
<img class="ion" src="/img/ionicons/warning-outline.svg">
374-
<p>
373+
<div>{{< warning-icon >}}</div>
374+
<div>
375375
Disabling <code>prefer_ordering_index</code> in MySQL &le; 8.0.39 causes another bug: MySQL does not scan the primary key for <code>SELECT ... FROM t ORDER BY pk_col LIMIT n</code>.
376376
Instead, it does a <em><b>full</b> table scan</em> plus sort, which is unnecessary and very likely to cause problems.
377377
Unlike the main subject of this blog post, I would call this a real bug.
378378
Thank you to Jay Janssen and Morgan Tocker for brining this to my attention.
379379
<br><br>
380380
I fixed <a href="https://bugs.mysql.com/bug.php?id=113699">this bug</a> in MySQL 8.0.40.
381-
</p>
381+
</div>
382382
</div>
383383
384384
Bottom line: you may never be bitten by the infamous ORDER BY LIMIT query optimizer bug, but if you are, you can disable the optimizer flag, or workaround by increasing the `LIMIT` value to change the cost calculations, or use `FORCE INDEX` to force the original secondary index.

content/lessons-from-20-years-hacking-mysql-part-1.md

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -119,13 +119,13 @@ But overall I've been successful thanks to a slim majority of random good luck:
119119
This is true for my 20 years with MySQL, my whole career, and my whole life.
120120
All the biggest successes of my life started with random good luck: right place, right time, right people&mdash;that kind of thing.
121121

122-
Good luck opens doors, but you have to walk through and hike the hill or climb the mountain on the other side.
122+
Good luck opens doors, but you have to walk through and climb the mountain on the other side.
123123
That's where the 47% hard work and patience comes in: all the success stories I know took at least 5 years, but 10 years is more typical.
124124
It takes time to build value, and even longer to change the way people work.
125125

126126
And 2% skill?
127127
At this point in my career, I hope it's not a conceit to say that I've got more skill than that.
128-
But along the way&mdash;hiking the hill or climbing the mountain&mdash;success is built by operating a little beyond the current limits.
128+
But along the way&mdash;climbing the mountain&mdash;success is built by operating a little beyond the current limits.
129129
Or, as David Bowie said:
130130

131131
> If you feel safe in the area you’re working in, you’re not working in the right area. Always go a little further into the water than you feel you’re capable of being in. Go a little bit out of your depth. And when you don’t feel that your feet are quite touching the bottom, you’re just about in the right place to do something exciting.
@@ -154,7 +154,7 @@ But if you don't tilt the field in your favor, then you have even odds of succes
154154
If biasing towards success sounds like a "pick yourself up by the bootstrap" cliché, then think of it like a video game: you know success is possible (it's programmed into the game), but you have to complete quests, get items, defeat bosses, and gain skills and experience.
155155
After awhile, success comes easily because you're a high-level player.
156156

157-
Real life is surprising like a video game.
157+
Real life is surprisingly like a video game.
158158
Success is possible; it's even programmed into the "game" because most people and most of the world wants you to succeed.
159159
But there are definitely enemies and bosses&mdash;competition and people who don't want you to succeed&mdash;which is why success takes work.
160160

@@ -201,7 +201,9 @@ It will protect you from every attack at work.
201201
It will attract all the best people and opportunities to you.
202202
Hold on to it.
203203

204-
<div style="text-align:center"><img src="/img/ionicons/shield-outline.svg" style="height:2rem; display:inline;" alt="shiedl"></div>
204+
<div id="magical-shield" style="text-align:center">
205+
<svg xmlns="http://www.w3.org/2000/svg" class="ionicon" viewBox="0 0 512 512"><path d="M463.1 112.37C373.68 96.33 336.71 84.45 256 48c-80.71 36.45-117.68 48.33-207.1 64.37C32.7 369.13 240.58 457.79 256 464c15.42-6.21 223.3-94.87 207.1-351.63z" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32"/></svg>
206+
</div>
205207

206208
Success and failure are not random.
207209
Randomness is only part of success.
@@ -353,10 +355,3 @@ Learning how to raise issues and call out problems _without_ being be labeled a
353355
As an engineer who builds and fixes things, the temptation to fix the business is powerful, but until you have that skill, tread very lightly and hold onto your [magical shield](#shield).
354356

355357
[^7]: Rule #1 for raising issues or calling out problems without being be labeled a naysayer or obstructionist: _offer realistic solutions or ways to improve_.
356-
357-
---
358-
359-
<div style="text-align:center">
360-
361-
[Part 2: Philosophy]({{< ref "lessons-from-20-years-hacking-mysql-part-2" >}})
362-
</div>

layouts/404.html

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
{{ define "main" }}
22
<main class="notfound">
3-
<br><br><br>
43
<h1>404 Page Not Found</h1>
54
<p>This error has been logged and will be fixed with a redirect if the page or alternative content exists.</p>
65
<p>Here's a secret gift for your troubles:</p>
7-
<p>
8-
<img class="ion" src="/img/ionicons/gift-outline.svg" style="vertical-align:middle">
9-
<a href="https://www.oreilly.com/library/view/efficient-mysql-performance/9781098105082/ch01.html">Chapter 1</a> of my book <i>Efficient MySQL Performance</i>.
10-
</p>
6+
<div style="display:flex; gap:1rem; align-items:center;">
7+
<div>
8+
<svg xmlns="http://www.w3.org/2000/svg" class="ionicon" viewBox="0 0 512 512"><path d="M256 104v56h56a56 56 0 10-56-56zM256 104v56h-56a56 56 0 1156-56z" fill="none" stroke="currentColor" stroke-linecap="round" stroke-miterlimit="10" stroke-width="32"/><rect x="64" y="160" width="384" height="112" rx="32" ry="32" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32"/><path d="M416 272v144a48 48 0 01-48 48H144a48 48 0 01-48-48V272M256 160v304" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32"/></svg>
9+
</div>
10+
<div>
11+
<a href="https://www.oreilly.com/library/view/efficient-mysql-performance/9781098105082/ch01.html">Chapter 1</a> of my book <i>Efficient MySQL Performance</i>.
12+
</div>
13+
</div>
1114
</main>
1215
{{ end }}

layouts/_default/single.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
{{ end }}
1818
<div class="pr"><span><i>Learn MySQL Performance</i></span>&nbsp;&nbsp;<a href="{{ $r }}">{{ $n }}</a></div>
1919
{{ end }}
20-
<img width="120" height="106" src="/img/emp-bird.png" alt="Efficient MySQL Performance bird">
20+
<img width="120" height="106" src="/img/emp-bird-2.png" alt="Efficient MySQL Performance bird">
2121
<p><b><i>Efficient MySQL Performance</i></b><br>20 years of MySQL performance, written for software engineers</p>
2222
<div class="book-buttons">
2323
<a class="book-button" data-dst="oreilly" href="https://oreil.ly/efficient-mysql-performance">O'Reilly&nbsp;&Rang;</a><br>

layouts/partials/disqus.html

Lines changed: 0 additions & 7 deletions
This file was deleted.

layouts/partials/post_meta.html

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
{{ if .Date }}
44
{{ .Date.Format "Jan 2, 2006" }}
55
{{ if ne .Date .Page.Params.Lastmod }}
6-
<img class="ion" src="/img/ionicons/refresh-outline.svg" style="height:0.9em; color:inherit; margin:0">
6+
<svg xmlns="http://www.w3.org/2000/svg" style="height:1rem" viewBox="0 0 512 512"><path d="M320 146s24.36-12-64-12a160 160 0 10160 160" fill="none" stroke="currentColor" stroke-linecap="round" stroke-miterlimit="10" stroke-width="32"/><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32" d="M256 58l80 80-80 80"/></svg>
77
{{ dateFormat "Jan 2, 2006" $.Page.Params.Lastmod }}
88
{{ end }}
99
{{ end }}
@@ -16,4 +16,3 @@
1616
</div>
1717
{{ end }}
1818
</div>
19-

layouts/path/single.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
{{ partial "path.html" . }}
88
</div>
99
<div style="margin-top:3em">
10-
<img width="120" height="106" src="/img/emp-bird.png" alt="Efficient MySQL Performance bird">
10+
<img width="120" height="106" src="/img/emp-bird-2.png" alt="Efficient MySQL Performance bird">
1111
<p><b><i>Efficient MySQL Performance</i></b><br>20 years of MySQL performance, written for software engineers</p>
1212
<div class="book-buttons">
1313
<a class="book-button" data-dst="oreilly" href="https://oreil.ly/efficient-mysql-performance">O'Reilly&nbsp;&Rang;</a><br>

layouts/shortcodes/alert-icon.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<svg xmlns="http://www.w3.org/2000/svg" class="ionicon" viewBox="0 0 512 512"><path d="M448 256c0-106-86-192-192-192S64 150 64 256s86 192 192 192 192-86 192-192z" fill="none" stroke="currentColor" stroke-miterlimit="10" stroke-width="32"/><path d="M250.26 166.05L256 288l5.73-121.95a5.74 5.74 0 00-5.79-6h0a5.74 5.74 0 00-5.68 6z" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32"/><path d="M256 367.91a20 20 0 1120-20 20 20 0 01-20 20z" fill="currentColor"/></svg>

0 commit comments

Comments
 (0)