mirror of
https://github.com/opensourcepos/opensourcepos.git
synced 2026-03-06 08:11:12 -05:00
Requested Changes
- Removed unnecessary indices on deleted column where there would not be many rows. - Removed unnecessary parenthesis in Item Model. - Added Composite indices based on MySQL EXPLAIN results.
This commit is contained in:
@@ -8,7 +8,7 @@ ALTER TABLE `ospos_attribute_definitions` ADD INDEX(`definition_name`);
|
||||
ALTER TABLE `ospos_attribute_definitions` ADD INDEX(`definition_type`);
|
||||
|
||||
#opsos_attribute_links table
|
||||
ALTER TABLE `ospos_attribute_links` ADD UNIQUE INDEX `attribute_links_uq2` (`item_id`, `receiving_id`, `sale_id`, `definition_id`, `attribute_id`);
|
||||
ALTER TABLE `ospos_attribute_links` ADD UNIQUE INDEX `attribute_links_uq2` (`item_id`,`sale_id`,`receiving_id`,`definition_id`,`attribute_id`);
|
||||
|
||||
#ospos_cash_up table
|
||||
ALTER TABLE `ospos_cash_up` MODIFY `deleted` tinyint(1) DEFAULT 0 NOT NULL;
|
||||
@@ -23,12 +23,10 @@ ALTER TABLE `ospos_customers` ADD INDEX(`company_name`);
|
||||
|
||||
#ospos_customers_packages table
|
||||
ALTER TABLE `ospos_customers_packages` MODIFY `deleted` tinyint(1) DEFAULT 0 NOT NULL;
|
||||
ALTER TABLE `ospos_customers_packages` ADD INDEX(`deleted`);
|
||||
|
||||
#ospos_dinner_tables table
|
||||
ALTER TABLE `ospos_dinner_tables` MODIFY `deleted` tinyint(1) DEFAULT 0 NOT NULL;
|
||||
ALTER TABLE `ospos_dinner_tables` ADD INDEX(`status`);
|
||||
ALTER TABLE `ospos_dinner_tables` ADD INDEX(`deleted`);
|
||||
|
||||
#ospos_employees table
|
||||
DROP INDEX `person_id` ON `ospos_employees`;
|
||||
@@ -52,8 +50,8 @@ ALTER TABLE `ospos_giftcards` MODIFY `deleted` tinyint(1) DEFAULT 0 NOT NULL;
|
||||
ALTER TABLE `ospos_items` MODIFY `deleted` tinyint(1) DEFAULT 0 NOT NULL;
|
||||
ALTER TABLE `ospos_items` MODIFY `stock_type` tinyint(1) DEFAULT 0 NOT NULL;
|
||||
ALTER TABLE `ospos_items` MODIFY `item_type` tinyint(1) DEFAULT 0 NOT NULL;
|
||||
ALTER TABLE `ospos_items` ADD INDEX(`deleted`);
|
||||
ALTER TABLE `ospos_items` ADD INDEX(`item_type`);
|
||||
ALTER TABLE `ospos_items` ADD INDEX(`deleted`, `item_type`);
|
||||
ALTER TABLE `ospos_items` ADD INDEX(`PRIMARY`, `deleted`);
|
||||
ALTER TABLE `ospos_items` ADD UNIQUE INDEX `items_uq1` (`supplier_id`, `item_id`, `deleted`, `item_type`);
|
||||
|
||||
#ospos_item_kits table
|
||||
@@ -62,6 +60,9 @@ ALTER TABLE `ospos_item_kits` MODIFY `price_option` tinyint(1) DEFAULT 0 NOT NUL
|
||||
ALTER TABLE `ospos_item_kits` MODIFY `print_option` tinyint(1) DEFAULT 0 NOT NULL;
|
||||
ALTER TABLE `ospos_item_kits` ADD INDEX(`name`,`description`);
|
||||
|
||||
#ospos_item_quantities table
|
||||
ALTER TABLE `ospos_item_quantities` ADD INDEX(`PRIMARY`,`item_id`,`location_id`);
|
||||
|
||||
#ospos_people table
|
||||
ALTER TABLE `ospos_people` ADD INDEX(`first_name`, `last_name`, `email`, `phone_number`);
|
||||
|
||||
@@ -97,7 +98,8 @@ DROP INDEX `person_id` ON `ospos_suppliers`;
|
||||
ALTER TABLE `ospos_suppliers` MODIFY `deleted` tinyint(1) DEFAULT 0 NOT NULL;
|
||||
ALTER TABLE `ospos_suppliers` MODIFY `category` tinyint(1) NOT NULL;
|
||||
ALTER TABLE `ospos_suppliers` ADD PRIMARY KEY(`person_id`);
|
||||
ALTER TABLE `ospos_suppliers` ADD INDEX(`category`);
|
||||
ALTER TABLE `ospos_suppliers` ADD INDEX(`category`);
|
||||
ALTER TABLE `ospos_suppliers` ADD INDEX(`company_name`, `deleted`);
|
||||
|
||||
#ospos_tax_categories table
|
||||
ALTER TABLE `ospos_tax_categories` MODIFY `deleted` tinyint(1) DEFAULT 0 NOT NULL;
|
||||
|
||||
Reference in New Issue
Block a user