| | 2 | |
| | 3 | = Views = |
| | 4 | |
| | 5 | * View 1: daily_clinic_schedule |
| | 6 | * View 2: pet_medical_history |
| | 7 | * View 3: active_prescriptions_for_pet |
| | 8 | * View 4: employee_performance_summary |
| | 9 | * View 5: invoice_billing_details |
| | 10 | * View 6: low_stock_shop_items |
| | 11 | |
| | 12 | = Indexes = |
| | 13 | To improve view performance, the following indexes were implemented: |
| | 14 | |
| | 15 | * idx_appointment_date on appointment(date_appointment) |
| | 16 | * idx_appointment_pet on appointment(pet_id) |
| | 17 | * idx_examination_appointment on examination(appointment_id) |
| | 18 | * idx_treatment_attribute_value_treatment on treatment_attribute_value(treatment_id) |
| | 19 | * idx_prescription_active_dates on prescription(date_end, date_start) |
| | 20 | * idx_treatment_examination on treatment(examination_id) |
| | 21 | * idx_treatment_date on treatment(date_treatment) |
| | 22 | * idx_invoice_item_treatment on invoice_item(treatment_id) |
| | 23 | * idx_invoice_owner on invoice(owner_id) |
| | 24 | * idx_invoice_item_invoice_id on invoice_item(invoice_id, num_item) |
| | 25 | * idx_payment_invoice on payment(invoice_id) |
| | 26 | * idx_shop_item_stock on shop_item(stock) |
| | 27 | * idx_shop_item_category_name on shop_item_category(name) |
| | 28 | |
| | 29 | Detailed documentation: |
| | 30 | [] |
| | 31 | |
| | 32 | Script: |
| | 33 | [https://develop.finki.ukim.mk/projects/pawcare/attachment/wiki/QueryOptimization/views.sql] |