{"id":15431657,"url":"https://github.com/meltrust/vet-clinic-database","last_synced_at":"2026-03-18T17:25:32.987Z","repository":{"id":45557798,"uuid":"436301594","full_name":"Meltrust/vet-clinic-database","owner":"Meltrust","description":null,"archived":false,"fork":false,"pushed_at":"2021-12-09T02:10:54.000Z","size":405,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"dev","last_synced_at":"2025-07-31T05:54:30.649Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Meltrust.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-12-08T15:42:06.000Z","updated_at":"2022-05-30T13:18:50.000Z","dependencies_parsed_at":"2022-08-27T18:20:52.266Z","dependency_job_id":null,"html_url":"https://github.com/Meltrust/vet-clinic-database","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Meltrust/vet-clinic-database","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Meltrust%2Fvet-clinic-database","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Meltrust%2Fvet-clinic-database/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Meltrust%2Fvet-clinic-database/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Meltrust%2Fvet-clinic-database/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Meltrust","download_url":"https://codeload.github.com/Meltrust/vet-clinic-database/tar.gz/refs/heads/dev","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Meltrust%2Fvet-clinic-database/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29195168,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-07T12:38:28.597Z","status":"ssl_error","status_checked_at":"2026-02-07T12:38:23.888Z","response_time":63,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-01T18:23:41.358Z","updated_at":"2026-02-07T13:32:24.225Z","avatar_url":"https://github.com/Meltrust.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# Vet clinic database\n\n\u003e A vet clinic database audited to improve its performance.\n\nVet clinic is a database that at first had performance problems when seeded with big amounts of data. Now it's lightning fast.\n\n## Performance before-after when querying all visits where animal_id = 4  \n\u003cimg src=\"ScreenShot.png\"\u003e\n\n## Performance before-after when querying all visits where vet_id = 2 \n\n\u003cimg src=\"ScreenShot1.png\"\u003e\n\n## Performance before-after when querying all owners by email  \n\n\u003cimg src=\"ScreenShot3.png\"\u003e\n\n## Made with\n\n- PostgreSQL\n- VSCode\n\n\n## Future additions\n\n- More optimizing\n\n## Getting Started\n\nTo get a local copy up and running follow these simple example steps:\n\n1. Under the repository name, click the Clone or download green button.\n\n![clone](https://user-images.githubusercontent.com/53324035/73660989-4451aa80-4667-11ea-8a89-176f89d6548a.png)\n\n2. Copy the URL given by clicking the clipboard button\n\n3. Open a terminal window in your local machine and change the current directory to the one you want the clone directory to be made.\n\n4. Type  git clone and the paste the URL you previusly copied to the clipboard\n\n5. Change the current directory to the newly created folder\n\n6. PostgreSQL must be installed and running.  Create the database `createdb vet-clinic` in your terminal, and access it through `psql vet-clinic`. Use the commands on the schema.sql file one by one to create the tables  and data.sql to populate tables with the initial data.\n\n7. Add the email column inside the owners table \n\n```sql\nALTER TABLE owners ADD COLUMN email VARCHAR(120);\n```\n8. Insert data into your database with the following commands \n\n```sql\nINSERT INTO visits (animal_id, vet_id, date_of_visit) SELECT * FROM (SELECT id FROM animals) animal_ids, (SELECT id FROM vets) vets_ids, generate_series('1980-01-01'::timestamp, '2021-01-01', '4 hours') visit_timestamp;\n\ninsert into owners (full_name, email) select 'Owner ' || generate_series(1,2500000), 'owner_' || generate_series(1,2500000) || '@mail.com';\n\n```\n\n9. Auditing performance\n\n```sql\nexplain analyze SELECT * FROM visits where vet_id = 2;\n\nexplain analyze SELECT * FROM owners where email = 'owner_18327@mail.com';\n\nexplain analyze SELECT COUNT(*) FROM visits where animal_id = 4;\n\n```\n\n\n## Authors\n\n👤 **Miguel Tapia**\n\n- Github: [@meltrust](https://github.com/meltrust)\n- Linkedin: [linkedin](https://www.linkedin.com/in/meltrust/)\n- Or talk to me directly at: original.mtapia@outlook.com\n\n👤 **Amal Hersi**\n\n- GitHub: [Amal Hersi](https://github.com/Amalcxc)\n- Twitter: [@Amalcx4](https://twitter.com/home?lang=en)\n- LinkedIn: [Amal Hersi](https://www.linkedin.com/in/amal-hersi-a29583205/)\n\n\n## 🤝 Contributing\n\nContributions, issues and feature requests are welcome!\n\nFeel free to check the [issues page](issues/).\n\n## Show your support\n\nGive a ⭐️ if you like this project!\n\n## Acknowledgments\n\n- Hat tip to anyone whose code was used\n- Inspiration\n- etc\n\n## 📝 License\n\nThis project is [MIT](lic.url) licensed.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmeltrust%2Fvet-clinic-database","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmeltrust%2Fvet-clinic-database","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmeltrust%2Fvet-clinic-database/lists"}