Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/emmanuelaaron/vet-clinic-database
https://github.com/emmanuelaaron/vet-clinic-database
Last synced: 22 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/emmanuelaaron/vet-clinic-database
- Owner: Emmanuelaaron
- Created: 2021-11-02T15:00:20.000Z (about 3 years ago)
- Default Branch: develop
- Last Pushed: 2021-11-02T23:11:38.000Z (about 3 years ago)
- Last Synced: 2024-11-20T18:33:58.029Z (about 2 months ago)
- Size: 1.05 MB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# VET CLINIC DATABASE AUDIT
- This task involved auditing the database of a Vet clinic and improving on the perfomance of some select queries as below.
## Problem 1
### SELECT COUNT(*) FROM visits where animal_id = 4;
- Before perfomance tuning
- After perfomance tuning### Explanantion of problem and solution
- For the first part we verify the tables and realize that there was no need to modify any of the tables, but we agree that the problem was on the data query itself, so we modify the request to be:
```
SELECT COUNT(animal_id) FROM visits where animal_id = 4;
```
So the query only takes in cosideration the animal_id colum.When we test it out we realize that the execution time was reduce from 1751ms to just 829ms.
## Problem 2
### SELECT * FROM visits where vet_id = 2;
- Before perfomance tuning
- After perfomance tuning### Explanantion of problem and solution
- For this part we created an index for the column vet_id using:
```CREATE INDEX visits_vet_id_asc ON visits(vet_id ASC);```When we tested it we realized that the execution time reduced from 3995.222 ms to 3621.804 ms
## Problem 3
### SELECT * FROM owners where email = '[email protected]';
- Before perfomance tuning
- After perfomance tuning### Explanantion of problem and solution
- For thus problem since the query was using the email as the conditional, we created a Non-clustered index on the email column of the owners table.
- It reduced the execution time from 2337.774 ms to 0.142 ms
## Authors
👤 **Opeyemi Oyelesi**
- GitHub: [@AdedayoOpeyemi](https://github.com/AdedayoOpeyemi)
- Twitter: [@Oyelesiopy](https://twitter.com/oyelesiopy)
- LinkedIn: [Opeyemi Oyelesi](https://linkedin.com/in/opeyemioyelesi)👤 **Jose Alberto Arriaga Ramos**
- Github: [@jaarkira](https://github.com/jaar91)
- Twitter: [@91_jaar](https://twitter.com/91_jaar)
- Linkedin: [Jose Arriaga](https://www.linkedin.com/in/jaar/)👤 **Emmanuel Isabirye**
- Github: [@gEmmanuelaaron](https://github.com/emmanuelaaron)
- Twitter: [@Emmanuel Isabirye](https://twitter.com/EmmanuelIsabir1)
- Linkedin: [Emmanuel Isabirye](https://www.linkedin.com/in/fullstackwebdev-emma/)## 🤝 Contributing
Contributions, issues, and feature requests are welcome!
Feel free to check the [issues page](https://github.com/emmanuelaaron/issues).
## Show your support
Give a ⭐️ if you like this project!
## Acknowledgments
- Hat tip to anyone whose code was used
- Inspiration
- etc## 📝 License
This project is [MIT](./MIT.md) licensed.