Recently, I have been suffering from the storage process of returning to the peripheral list for a long time, because the sorting fields are obtained from other tables. Finally, by creating an additional record table, you can record the corresponding records when you sign in at ordinary times. Therefore, when you return to the peripheral list, these fields can be searched directly from the table, and the index is used, so it is very fast. However, another field is real-time, so it must be obtained when the stored procedure is executed. Start preparing to use a temporary table .. group by is used to obtain all the fields and insert them into the temporary table. This operation is indeed very fast. The next time you retrieve these values and sort them, you can directly obtain them from the temporary table based on a condition. -Www.2cto.com-
But it is still very slow. The heap table is used. Because the index cannot be created for a temporary table, the condition value is still relatively slow. Therefore, creating an index is better than creating a real table. A temporary table can be created to store all the data to be used for operations without selecting records based on the conditions. When creating a real table, you must pay attention to the concurrency issue. If the time is not long, we recommend that you use the lock table operation to ensure operation consistency. From the column of kofandlizi