Remove redundant space in `code ` block

pull/667/head
Sean Wei 2022-04-25 16:29:19 +08:00
parent 7dacbb002a
commit 0a4fea0a9a
2 changed files with 4 additions and 4 deletions

View File

@ -110,7 +110,7 @@ PRIMARY KEY(id)
FOREIGN KEY(user_id) REFERENCES users(id)
```
We'll create an [index](https://github.com/donnemartin/system-design-primer#use-good-indices) on `id`, `user_id `, and `created_at` to speed up lookups (log-time instead of scanning the entire table) and to keep the data in memory. Reading 1 MB sequentially from memory takes about 250 microseconds, while reading from SSD takes 4x and from disk takes 80x longer.<sup><a href=https://github.com/donnemartin/system-design-primer#latency-numbers-every-programmer-should-know>1</a></sup>
We'll create an [index](https://github.com/donnemartin/system-design-primer#use-good-indices) on `id`, `user_id`, and `created_at` to speed up lookups (log-time instead of scanning the entire table) and to keep the data in memory. Reading 1 MB sequentially from memory takes about 250 microseconds, while reading from SSD takes 4x and from disk takes 80x longer.<sup><a href=https://github.com/donnemartin/system-design-primer#latency-numbers-every-programmer-should-know>1</a></sup>
We'll use a public [**REST API**](https://github.com/donnemartin/system-design-primer#representational-state-transfer-rest):
@ -160,7 +160,7 @@ PRIMARY KEY(id)
FOREIGN KEY(user_id) REFERENCES users(id)
```
We'll create an [index](https://github.com/donnemartin/system-design-primer#use-good-indices) on `id`, `user_id `, and `created_at`.
We'll create an [index](https://github.com/donnemartin/system-design-primer#use-good-indices) on `id`, `user_id`, and `created_at`.
The `monthly_spending` table could have the following structure:
@ -174,7 +174,7 @@ PRIMARY KEY(id)
FOREIGN KEY(user_id) REFERENCES users(id)
```
We'll create an [index](https://github.com/donnemartin/system-design-primer#use-good-indices) on `id` and `user_id `.
We'll create an [index](https://github.com/donnemartin/system-design-primer#use-good-indices) on `id` and `user_id`.
#### Category service

View File

@ -196,7 +196,7 @@ FOREIGN KEY(category_id) REFERENCES Categories(id)
FOREIGN KEY(product_id) REFERENCES Products(id)
```
We'll create an [index](https://github.com/donnemartin/system-design-primer#use-good-indices) on `id `, `category_id`, and `product_id` to speed up lookups (log-time instead of scanning the entire table) and to keep the data in memory. Reading 1 MB sequentially from memory takes about 250 microseconds, while reading from SSD takes 4x and from disk takes 80x longer.<sup><a href=https://github.com/donnemartin/system-design-primer#latency-numbers-every-programmer-should-know>1</a></sup>
We'll create an [index](https://github.com/donnemartin/system-design-primer#use-good-indices) on `id`, `category_id`, and `product_id` to speed up lookups (log-time instead of scanning the entire table) and to keep the data in memory. Reading 1 MB sequentially from memory takes about 250 microseconds, while reading from SSD takes 4x and from disk takes 80x longer.<sup><a href=https://github.com/donnemartin/system-design-primer#latency-numbers-every-programmer-should-know>1</a></sup>
### Use case: User views the past week's most popular products by category