USE yami_bbc;

ALTER TABLE `tz_attach_file`
ADD INDEX `shop_id_index`(`shop_id`) USING BTREE;

ALTER TABLE `tz_attach_file_group`
ADD INDEX `shop_id_index`(`shop_id`) USING BTREE;

ALTER TABLE `tz_basket`
ADD INDEX `discount_id`(`discount_id`) USING BTREE,
ADD INDEX `combo_id`(`combo_id`) USING BTREE;

ALTER TABLE `tz_company_auditing`
ADD INDEX `user_id`(`user_id`) USING BTREE,
ADD INDEX `shop_company_id`(`shop_company_id`) USING BTREE,
ADD INDEX `auditor_id`(`auditor_id`) USING BTREE;

ALTER TABLE `tz_delivery_order`
ADD INDEX `dvy_id`(`dvy_id`) USING BTREE;

ALTER TABLE `tz_distribution_msg`
ADD INDEX `shop_id`(`shop_id`) USING BTREE;

ALTER TABLE `tz_distribution_prod_log`
ADD INDEX `shop_id`(`shop_id`) USING BTREE,
ADD INDEX `prod_id`(`prod_id`) USING BTREE,
ADD INDEX `user_id`(`user_id`) USING BTREE;

ALTER TABLE `tz_distribution_user_income`
ADD INDEX `wallet_id`(`wallet_id`) USING BTREE,
ADD INDEX `merchant_order_id`(`merchant_order_id`) USING BTREE,
ADD INDEX `order_number`(`order_number`) USING BTREE;

ALTER TABLE `tz_distribution_withdraw_cash`
ADD INDEX `merchant_order_id`(`merchant_order_id`) USING BTREE;

ALTER TABLE `tz_flow_log`
ADD INDEX `user_id`(`user_id`) USING BTREE;

ALTER TABLE `tz_giveaway`
ADD INDEX `prod_id`(`prod_id`) USING BTREE;

ALTER TABLE `tz_giveaway_prod`
ADD INDEX `sku_id`(`sku_id`) USING BTREE;

ALTER TABLE `tz_group_activity`
ADD INDEX `prod_id`(`prod_id`) USING BTREE;

ALTER TABLE `tz_group_order`
ADD INDEX `activity_id`(`group_activity_id`) USING BTREE,
ADD INDEX `prod_id`(`prod_id`) USING BTREE;

ALTER TABLE `tz_group_team`
ADD INDEX `prod_id`(`prod_id`) USING BTREE,
ADD INDEX `share_user_id`(`share_user_id`) USING BTREE;

ALTER TABLE `tz_im_msg_biz_employee_recent`
ADD INDEX `biz_id`(`biz_id`) USING BTREE,
ADD INDEX `user_id`(`user_id`) USING BTREE;

ALTER TABLE `tz_im_msg_biz_user`
ADD INDEX `biz_id`(`biz_id`) USING BTREE,
ADD INDEX `employee_id`(`employee_id`) USING BTREE;

ALTER TABLE `tz_im_msg_biz_user_history`
ADD INDEX `biz_id`(`biz_id`) USING BTREE,
ADD INDEX `employee_id`(`employee_id`) USING BTREE;

ALTER TABLE `tz_notify_log`
ADD INDEX `template_id`(`template_id`) USING BTREE;

ALTER TABLE `tz_order`
ADD INDEX `addr_order_id`(`addr_order_id`) USING BTREE,
ADD INDEX `dvy_id`(`dvy_id`) USING BTREE;

ALTER TABLE `tz_order_invoice`
ADD INDEX `file_id`(`file_id`) USING BTREE;

ALTER TABLE `tz_order_item`
ADD INDEX `shop_id`(`shop_id`) USING BTREE,
ADD INDEX `sku_prod_id`(`sku_id`, `prod_id`) USING BTREE,
ADD INDEX `user_id`(`user_id`) USING BTREE;

ALTER TABLE `tz_order_refund`
ADD INDEX `shop_id`(`shop_id`) USING BTREE,
ADD INDEX `user_id`(`user_id`) USING BTREE,
ADD INDEX `order_item_id`(`order_item_id`) USING BTREE;

ALTER TABLE `tz_order_refund_intervention`
ADD INDEX `refund_id`(`refund_id`) USING BTREE;

ALTER TABLE `tz_order_self_station`
ADD INDEX `shop_id`(`shop_id`) USING BTREE,
ADD INDEX `order_number`(`order_number`) USING BTREE;

ALTER TABLE `tz_order_virtual_info`
ADD INDEX `shop_id`(`shop_id`) USING BTREE,
ADD INDEX `station_id`(`station_id`) USING BTREE;

ALTER TABLE `tz_order_virtual_verify_log`
ADD INDEX `order_number`(`order_number`) USING BTREE,
ADD INDEX `station_id`(`station_id`) USING BTREE;

ALTER TABLE `tz_outlet_config`
ADD INDEX `shop_id`(`shop_id`) USING BTREE,
ADD INDEX `partner_id`(`partner_id`) USING BTREE;

ALTER TABLE `tz_pay_info`
ADD INDEX `biz_order_no`(`biz_order_no`) USING BTREE;

ALTER TABLE `tz_popup_relate`
ADD INDEX `user_level_id`(`user_level_id`) USING BTREE;

ALTER TABLE `tz_printer`
ADD INDEX `shop_id`(`shop_id`) USING BTREE;

ALTER TABLE `tz_prod`
ADD INDEX `brand_id`(`brand_id`) USING BTREE,
ADD INDEX `delivery_template_id`(`delivery_template_id`) USING BTREE;

ALTER TABLE `tz_prod_browse_log`
ADD INDEX `shop_id`(`shop_id`) USING BTREE,
ADD INDEX `category_id`(`category_id`) USING BTREE;

ALTER TABLE `tz_prod_comm`
ADD INDEX `shop_id`(`shop_id`) USING BTREE,
ADD INDEX `user_id`(`user_id`) USING BTREE,
ADD INDEX `order_item_id`(`order_item_id`) USING BTREE;

ALTER TABLE `tz_prod_favorite`
ADD INDEX `user_id`(`user_id`) USING BTREE;

ALTER TABLE `tz_prod_tag_reference`
ADD INDEX `shop_id`(`shop_id`) USING BTREE,
ADD INDEX `prod_id`(`prod_id`) USING BTREE;

ALTER TABLE `tz_purchase_order`
ADD INDEX `shop_id`(`shop_id`) USING BTREE,
ADD INDEX `dvy_id`(`dvy_id`) USING BTREE;

ALTER TABLE `tz_purchase_prod`
ADD INDEX `supplier_prod_id`(`supplier_prod_id`) USING BTREE;

ALTER TABLE `tz_refund_delivery`
ADD INDEX `shop_id`(`shop_id`) USING BTREE,
ADD INDEX `user_id`(`user_id`) USING BTREE,
ADD INDEX `dey_id`(`dey_id`) USING BTREE;

ALTER TABLE `tz_refund_order_settlement`
ADD INDEX `order_pay_no`(`order_pay_no`) USING BTREE,
ADD INDEX `pay_refund_id`(`pay_refund_id`) USING BTREE,
ADD INDEX `user_id`(`user_id`) USING BTREE,
ADD INDEX `order_number`(`order_number`) USING BTREE;

ALTER TABLE `tz_seckill`
ADD INDEX `shop_id`(`shop_id`) USING BTREE;

ALTER TABLE `tz_shop_employee`
ADD INDEX `shop_id`(`shop_id`) USING BTREE,
ADD INDEX `user_id`(`user_id`) USING BTREE;

ALTER TABLE `tz_shop_employee_role`
ADD INDEX `employee_role_id`(`employee_id`, `role_id`) USING BTREE;

ALTER TABLE `tz_shop_menu`
ADD INDEX `parent_id`(`parent_id`) USING BTREE;

ALTER TABLE `tz_shop_role`
ADD INDEX `create_employee_id`(`create_employee_id`) USING BTREE;

ALTER TABLE `tz_shop_wallet_log`
ADD INDEX `order_number`(`order_number`) USING BTREE,
ADD INDEX `refund_sn`(`refund_sn`) USING BTREE;

ALTER TABLE `tz_signing_auditing`
ADD INDEX `user_id`(`user_id`) USING BTREE,
ADD INDEX `auditor_id`(`auditor_id`) USING BTREE;

ALTER TABLE `tz_stock_bill_log`
ADD INDEX `source_order_no`(`source_order_no`) USING BTREE,
ADD INDEX `employee_id`(`employee_id`) USING BTREE;

ALTER TABLE `tz_supplier`
ADD INDEX `category_id`(`supplier_category_id`) USING BTREE;

ALTER TABLE `tz_sys_menu`
ADD INDEX `parent_id`(`parent_id`) USING BTREE;

ALTER TABLE `tz_sys_role`
ADD INDEX `user_id`(`create_user_id`) USING BTREE;

ALTER TABLE `tz_sys_user`
ADD INDEX `create_user_id`(`create_user_id`) USING BTREE;

ALTER TABLE `tz_user_tag_user`
ADD INDEX `tag_user_idex`(`user_tag_id`, `user_id`) USING BTREE;

ALTER TABLE `tz_user_withdraw_cash`
ADD INDEX `user_id`(`user_id`) USING BTREE;

ALTER TABLE `tz_order_settlement`
ADD INDEX `pay_no`(`pay_no`) USING BTREE;

ALTER TABLE `tz_flow_log`
ADD INDEX `create_time_idx`(`create_time`) USING BTREE,
ADD INDEX `uuid_idx`(`uuid`) USING BTREE,
ADD INDEX `page_id_idx`(`page_id`) USING BTREE,
ADD INDEX `system_type_idx`(`system_type`) USING BTREE,
ADD INDEX `visit_type_idx`(`visit_type`) USING BTREE;

ALTER TABLE `tz_flow_page_analyse`
ADD INDEX `create_date_idx`(`create_date`) USING BTREE,
ADD INDEX `page_id_idx`(`page_id`) USING BTREE,
ADD INDEX `system_type_idx`(`system_type`) USING BTREE,
ADD INDEX `biz_data_idx`(`biz_type`, `biz_date`) USING BTREE;

ALTER TABLE `tz_flow_page_analyse_user`
ADD INDEX `create_date_idx`(`create_date`) USING BTREE,
ADD INDEX `uuid_idx`(`uuid`) USING BTREE,
ADD INDEX `flow_page_analyse_id_idx`(`flow_page_analyse_id`) USING BTREE,
ADD INDEX `biz_data_idx`(`biz_type`, `biz_date`) USING BTREE;

ALTER TABLE `tz_flow_user_analysis`
ADD INDEX `create_date_idx`(`create_date`) USING BTREE,
ADD INDEX `system_type_idx`(`system_type`) USING BTREE;
