From 2bcfe8f87596e576ff73e50b230063bf17fc4fff Mon Sep 17 00:00:00 2001 From: Inga Date: Sun, 12 Jan 2025 22:54:47 +0000 Subject: [PATCH] added indexes on slots --- database/init.sql | 3 +++ 1 file changed, 3 insertions(+) diff --git a/database/init.sql b/database/init.sql index 7a4b539..39d71fe 100644 --- a/database/init.sql +++ b/database/init.sql @@ -14,6 +14,9 @@ create table if not exists slots ( sales_manager_id int not null references sales_managers(Id) ); +create index slots_manager_booked_start_date_idx on slots(sales_manager_id, booked, start_date); +create index slots_manager_booked_end_date_idx on slots(sales_manager_id, booked, end_date); + insert into sales_managers (name, languages, products, customer_ratings) values ('Seller 1', '{"German"}', '{"SolarPanels"}', '{"Bronze"}'); insert into sales_managers (name, languages, products, customer_ratings) values ('Seller 2', '{"German", "English"}', '{"SolarPanels", "Heatpumps"}', '{"Gold","Silver","Bronze"}'); insert into sales_managers (name, languages, products, customer_ratings) values ('Seller 3', '{"German", "English"}', '{"Heatpumps"}', '{"Gold","Silver","Bronze"}');