- About Project
- Built With
- Prerequisites
- Getting Started
- Contributing
- Author
- Acknowledgements
- Show your support
This project is built as a practice for optimizing search queries in a populated database. We start with a regular database, then fill it with data to slow down the query times, and then use optimization techniques to achieve faster query calls compared to the unoptimized ones. Using this project, you can replicate the database to see how you can also implement your own solutions to the problems, or see how your solution compares to ours.
The following are screenshot displaying the before and after results on analysing the SQL data.
explain analyze SELECT COUNT(*) FROM visits where animal_id = 4;
explain analyze SELECT * FROM visits where vet_id = 2;
explain analyze SELECT * FROM owners where email = 'owner_18327@mail.com';
- PostgreSQL
- Ensure you have PostgreSQL DBMS installed
sudo apt update && sudo apt install postgresql postgresql-contrib
-
Clone this repo https://github.com/enkog/vet-clinic-db
git clone https://github.com/enkog/vet-clinic-db.git
-
Navigate to vet-clinic folder/directory
cd vet-clinic
-
Create the
vet_clinic
database -
If you need help working with Postgres follow this GUIDE
-
Creating Tables
psql vet_clinic < schema.sql
- Add data to Tables
psql vet_clinic < data.sql
- Run the Queries
psql vet_clinic < queries.sql
Contributions, issues, and feature requests are welcome!
Feel free to check the issues page
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/newFeature
) - Commit your Changes (
git commit -m 'Add some newFeature'
) - Push to the Branch (
git push -u origin feature/newFeature
) - Open a Pull Request
👤 Oguadinma Nkiruka Ngozika
👤 Lameck Otieno
- GitHub: @githubhandle
- Twitter: @twitterhandle
- LinkedIn: LinkedIn
- Portfolio: Portfolio
- Postgres ORG for the documentation and guides on getting started with PostgreSQL DBMS.
Give a ⭐️ if you like this project!