Have a list of goods, have the status 0 1 2 represent a state of goods 1 normal 2 0 audit failure,
Due to do the cloud library goods, for others to collect call, so all the data to demonstrate the basic need status=1.
There are a few small screening project, I now do is index is as follows:
All the indexes of basic status, but because the library is millions of tens of millions of library, this effect is a bit poor, poor under the condition of high concurrency,
What are the members of relevant design experience can tell!
I now idea is to build a history of the library, library to put the failure in history, because of the failure of the basic query, but I had trouble with two tables, one table can pass appropriate indexes to solve this problem, please correct me big!!!!!
CodePudding user response:
The distribution of index to combine data and specific query SQL to design, your these information, also can't see your index design reasonable not reasonable,IO index is to reduce the effect of reading data, you should according to this point with your specific SQL and table data to design index,
Me your index are all status at the beginning of, this is not a right way to do it, completely the K_SELLER index, for example, I estimate the status=1 data should be not a few, you change the location of the index columns here, K_SELLER (sellid, status), if sellid is selective high column, so in the same status=1 and sellid=ABC conditions, K_SELLER (sellid status), first by sellid reduces the index scan range, status, or the actual situation sellid is a better choice, I mean here is to pay attention to the order of the index columns,
Your question involves too much information, not personally to the actual environment, it is difficult to get the best solution,
On establishing a library history, if you can handle code logic, reduce the amount of data table is always good for query,
CodePudding user response:
How goods table has tens of millions of data? Why is there seller salesman properties and goods list? I understand you this may be a selling goods table, there is a strong correlation with date, can adopt the way of the partition table to deal with,CodePudding user response:
This depends on how do you write your statement, the index is in the service of the statement,CodePudding user response: