2024-02-05-索引补充.sql 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225
  1. USE yami_bbc;
  2. ALTER TABLE `tz_attach_file`
  3. ADD INDEX `shop_id_index`(`shop_id`) USING BTREE;
  4. ALTER TABLE `tz_attach_file_group`
  5. ADD INDEX `shop_id_index`(`shop_id`) USING BTREE;
  6. ALTER TABLE `tz_basket`
  7. ADD INDEX `discount_id`(`discount_id`) USING BTREE,
  8. ADD INDEX `combo_id`(`combo_id`) USING BTREE;
  9. ALTER TABLE `tz_company_auditing`
  10. ADD INDEX `user_id`(`user_id`) USING BTREE,
  11. ADD INDEX `shop_company_id`(`shop_company_id`) USING BTREE,
  12. ADD INDEX `auditor_id`(`auditor_id`) USING BTREE;
  13. ALTER TABLE `tz_delivery_order`
  14. ADD INDEX `dvy_id`(`dvy_id`) USING BTREE;
  15. ALTER TABLE `tz_distribution_msg`
  16. ADD INDEX `shop_id`(`shop_id`) USING BTREE;
  17. ALTER TABLE `tz_distribution_prod_log`
  18. ADD INDEX `shop_id`(`shop_id`) USING BTREE,
  19. ADD INDEX `prod_id`(`prod_id`) USING BTREE,
  20. ADD INDEX `user_id`(`user_id`) USING BTREE;
  21. ALTER TABLE `tz_distribution_user_income`
  22. ADD INDEX `wallet_id`(`wallet_id`) USING BTREE,
  23. ADD INDEX `merchant_order_id`(`merchant_order_id`) USING BTREE,
  24. ADD INDEX `order_number`(`order_number`) USING BTREE;
  25. ALTER TABLE `tz_distribution_withdraw_cash`
  26. ADD INDEX `merchant_order_id`(`merchant_order_id`) USING BTREE;
  27. ALTER TABLE `tz_flow_log`
  28. ADD INDEX `user_id`(`user_id`) USING BTREE;
  29. ALTER TABLE `tz_giveaway`
  30. ADD INDEX `prod_id`(`prod_id`) USING BTREE;
  31. ALTER TABLE `tz_giveaway_prod`
  32. ADD INDEX `sku_id`(`sku_id`) USING BTREE;
  33. ALTER TABLE `tz_group_activity`
  34. ADD INDEX `prod_id`(`prod_id`) USING BTREE;
  35. ALTER TABLE `tz_group_order`
  36. ADD INDEX `activity_id`(`group_activity_id`) USING BTREE,
  37. ADD INDEX `prod_id`(`prod_id`) USING BTREE;
  38. ALTER TABLE `tz_group_team`
  39. ADD INDEX `prod_id`(`prod_id`) USING BTREE,
  40. ADD INDEX `share_user_id`(`share_user_id`) USING BTREE;
  41. ALTER TABLE `tz_im_msg_biz_employee_recent`
  42. ADD INDEX `biz_id`(`biz_id`) USING BTREE,
  43. ADD INDEX `user_id`(`user_id`) USING BTREE;
  44. ALTER TABLE `tz_im_msg_biz_user`
  45. ADD INDEX `biz_id`(`biz_id`) USING BTREE,
  46. ADD INDEX `employee_id`(`employee_id`) USING BTREE;
  47. ALTER TABLE `tz_im_msg_biz_user_history`
  48. ADD INDEX `biz_id`(`biz_id`) USING BTREE,
  49. ADD INDEX `employee_id`(`employee_id`) USING BTREE;
  50. ALTER TABLE `tz_notify_log`
  51. ADD INDEX `template_id`(`template_id`) USING BTREE;
  52. ALTER TABLE `tz_order`
  53. ADD INDEX `addr_order_id`(`addr_order_id`) USING BTREE,
  54. ADD INDEX `dvy_id`(`dvy_id`) USING BTREE;
  55. ALTER TABLE `tz_order_invoice`
  56. ADD INDEX `file_id`(`file_id`) USING BTREE;
  57. ALTER TABLE `tz_order_item`
  58. ADD INDEX `shop_id`(`shop_id`) USING BTREE,
  59. ADD INDEX `sku_prod_id`(`sku_id`, `prod_id`) USING BTREE,
  60. ADD INDEX `user_id`(`user_id`) USING BTREE;
  61. ALTER TABLE `tz_order_refund`
  62. ADD INDEX `shop_id`(`shop_id`) USING BTREE,
  63. ADD INDEX `user_id`(`user_id`) USING BTREE,
  64. ADD INDEX `order_item_id`(`order_item_id`) USING BTREE;
  65. ALTER TABLE `tz_order_refund_intervention`
  66. ADD INDEX `refund_id`(`refund_id`) USING BTREE;
  67. ALTER TABLE `tz_order_self_station`
  68. ADD INDEX `shop_id`(`shop_id`) USING BTREE,
  69. ADD INDEX `order_number`(`order_number`) USING BTREE;
  70. ALTER TABLE `tz_order_virtual_info`
  71. ADD INDEX `shop_id`(`shop_id`) USING BTREE,
  72. ADD INDEX `station_id`(`station_id`) USING BTREE;
  73. ALTER TABLE `tz_order_virtual_verify_log`
  74. ADD INDEX `order_number`(`order_number`) USING BTREE,
  75. ADD INDEX `station_id`(`station_id`) USING BTREE;
  76. ALTER TABLE `tz_outlet_config`
  77. ADD INDEX `shop_id`(`shop_id`) USING BTREE,
  78. ADD INDEX `partner_id`(`partner_id`) USING BTREE;
  79. ALTER TABLE `tz_pay_info`
  80. ADD INDEX `biz_order_no`(`biz_order_no`) USING BTREE;
  81. ALTER TABLE `tz_popup_relate`
  82. ADD INDEX `user_level_id`(`user_level_id`) USING BTREE;
  83. ALTER TABLE `tz_printer`
  84. ADD INDEX `shop_id`(`shop_id`) USING BTREE;
  85. ALTER TABLE `tz_prod`
  86. ADD INDEX `brand_id`(`brand_id`) USING BTREE,
  87. ADD INDEX `delivery_template_id`(`delivery_template_id`) USING BTREE;
  88. ALTER TABLE `tz_prod_browse_log`
  89. ADD INDEX `shop_id`(`shop_id`) USING BTREE,
  90. ADD INDEX `category_id`(`category_id`) USING BTREE;
  91. ALTER TABLE `tz_prod_comm`
  92. ADD INDEX `shop_id`(`shop_id`) USING BTREE,
  93. ADD INDEX `user_id`(`user_id`) USING BTREE,
  94. ADD INDEX `order_item_id`(`order_item_id`) USING BTREE;
  95. ALTER TABLE `tz_prod_favorite`
  96. ADD INDEX `user_id`(`user_id`) USING BTREE;
  97. ALTER TABLE `tz_prod_tag_reference`
  98. ADD INDEX `shop_id`(`shop_id`) USING BTREE,
  99. ADD INDEX `prod_id`(`prod_id`) USING BTREE;
  100. ALTER TABLE `tz_purchase_order`
  101. ADD INDEX `shop_id`(`shop_id`) USING BTREE,
  102. ADD INDEX `dvy_id`(`dvy_id`) USING BTREE;
  103. ALTER TABLE `tz_purchase_prod`
  104. ADD INDEX `supplier_prod_id`(`supplier_prod_id`) USING BTREE;
  105. ALTER TABLE `tz_refund_delivery`
  106. ADD INDEX `shop_id`(`shop_id`) USING BTREE,
  107. ADD INDEX `user_id`(`user_id`) USING BTREE,
  108. ADD INDEX `dey_id`(`dey_id`) USING BTREE;
  109. ALTER TABLE `tz_refund_order_settlement`
  110. ADD INDEX `order_pay_no`(`order_pay_no`) USING BTREE,
  111. ADD INDEX `pay_refund_id`(`pay_refund_id`) USING BTREE,
  112. ADD INDEX `user_id`(`user_id`) USING BTREE,
  113. ADD INDEX `order_number`(`order_number`) USING BTREE;
  114. ALTER TABLE `tz_seckill`
  115. ADD INDEX `shop_id`(`shop_id`) USING BTREE;
  116. ALTER TABLE `tz_shop_employee`
  117. ADD INDEX `shop_id`(`shop_id`) USING BTREE,
  118. ADD INDEX `user_id`(`user_id`) USING BTREE;
  119. ALTER TABLE `tz_shop_employee_role`
  120. ADD INDEX `employee_role_id`(`employee_id`, `role_id`) USING BTREE;
  121. ALTER TABLE `tz_shop_menu`
  122. ADD INDEX `parent_id`(`parent_id`) USING BTREE;
  123. ALTER TABLE `tz_shop_role`
  124. ADD INDEX `create_employee_id`(`create_employee_id`) USING BTREE;
  125. ALTER TABLE `tz_shop_wallet_log`
  126. ADD INDEX `order_number`(`order_number`) USING BTREE,
  127. ADD INDEX `refund_sn`(`refund_sn`) USING BTREE;
  128. ALTER TABLE `tz_signing_auditing`
  129. ADD INDEX `user_id`(`user_id`) USING BTREE,
  130. ADD INDEX `auditor_id`(`auditor_id`) USING BTREE;
  131. ALTER TABLE `tz_stock_bill_log`
  132. ADD INDEX `source_order_no`(`source_order_no`) USING BTREE,
  133. ADD INDEX `employee_id`(`employee_id`) USING BTREE;
  134. ALTER TABLE `tz_supplier`
  135. ADD INDEX `category_id`(`supplier_category_id`) USING BTREE;
  136. ALTER TABLE `tz_sys_menu`
  137. ADD INDEX `parent_id`(`parent_id`) USING BTREE;
  138. ALTER TABLE `tz_sys_role`
  139. ADD INDEX `user_id`(`create_user_id`) USING BTREE;
  140. ALTER TABLE `tz_sys_user`
  141. ADD INDEX `create_user_id`(`create_user_id`) USING BTREE;
  142. ALTER TABLE `tz_user_tag_user`
  143. ADD INDEX `tag_user_idex`(`user_tag_id`, `user_id`) USING BTREE;
  144. ALTER TABLE `tz_user_withdraw_cash`
  145. ADD INDEX `user_id`(`user_id`) USING BTREE;
  146. ALTER TABLE `tz_order_settlement`
  147. ADD INDEX `pay_no`(`pay_no`) USING BTREE;
  148. ALTER TABLE `tz_flow_log`
  149. ADD INDEX `create_time_idx`(`create_time`) USING BTREE,
  150. ADD INDEX `uuid_idx`(`uuid`) USING BTREE,
  151. ADD INDEX `page_id_idx`(`page_id`) USING BTREE,
  152. ADD INDEX `system_type_idx`(`system_type`) USING BTREE,
  153. ADD INDEX `visit_type_idx`(`visit_type`) USING BTREE;
  154. ALTER TABLE `tz_flow_page_analyse`
  155. ADD INDEX `create_date_idx`(`create_date`) USING BTREE,
  156. ADD INDEX `page_id_idx`(`page_id`) USING BTREE,
  157. ADD INDEX `system_type_idx`(`system_type`) USING BTREE,
  158. ADD INDEX `biz_data_idx`(`biz_type`, `biz_date`) USING BTREE;
  159. ALTER TABLE `tz_flow_page_analyse_user`
  160. ADD INDEX `create_date_idx`(`create_date`) USING BTREE,
  161. ADD INDEX `uuid_idx`(`uuid`) USING BTREE,
  162. ADD INDEX `flow_page_analyse_id_idx`(`flow_page_analyse_id`) USING BTREE,
  163. ADD INDEX `biz_data_idx`(`biz_type`, `biz_date`) USING BTREE;
  164. ALTER TABLE `tz_flow_user_analysis`
  165. ADD INDEX `create_date_idx`(`create_date`) USING BTREE,
  166. ADD INDEX `system_type_idx`(`system_type`) USING BTREE;