https://github.com/byhbt/laravel-database-indexes
Mockup app for review database index
https://github.com/byhbt/laravel-database-indexes
Last synced: 4 months ago
JSON representation
Mockup app for review database index
- Host: GitHub
- URL: https://github.com/byhbt/laravel-database-indexes
- Owner: byhbt
- Created: 2020-02-05T09:31:27.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2023-01-05T06:30:50.000Z (over 2 years ago)
- Last Synced: 2025-01-20T14:53:49.957Z (6 months ago)
- Language: PHP
- Size: 2.51 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 26
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## Setup
This is init data script for preparing data to learn database index.
```
php artisan migrate --seed
```It might take a little time because we init 300k row for user_video table.
## Review
1. Use ```EXPLAIN``` statement to see what type of MySQL index and how many rows it perform the queries.
2. Remove/Add index to **user_id** in **user_video** table, too se the different in performance.
3. Query the time range in the **user_video** table
- Index type = range

## Reference:
- [https://vanseodesign.com/web-design/the-types-of-indexes-you-can-add-to-mysql-tables/](https://vanseodesign.com/web-design/the-types-of-indexes-you-can-add-to-mysql-tables/)
- [https://dev.mysql.com/doc/sakila/en/](https://dev.mysql.com/doc/sakila/en/)## License
The app is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT).