Help, SQL execution suddenly slowed down, please everyone

Updated on society 2024-03-31
8 answers
  1. Anonymous users2024-02-07

    The full update to this order of magnitude will certainly be slow.

    First. Your records don't have to be in the same partition, second. I don't understand why so many people suggest that you build an index, the more indexes you build, the slower your updates will be, because you update the records at the same time as you update the index.

    Third. You must know that the bottleneck of slow updates is **. Whether it's too much reading and writing, or not enough memory, or not fast enough, then prescribe the right medicine.

    Here are two simple ways to do what might work:

    First, split the table in 100w rows vertically into two and connect them with foreign key relationships, one containing small and frequently changing data such as id, foreign key, state value, time, etc., and the other containing large and infrequently changing data, such as very long strings, xml, text, etc.

    In this way, the operation of this small table during update can greatly save memory and CPU overhead, and reduce disk operations.

    The downside is that the query is slower.

    Second: Cut the 100w row horizontally into many tables, for example, the records of each month are packed in a table, so that the number of records in each table may only be tens of thousands, and the query and update will be much faster.

    The disadvantage is that the query and update are not as easy to write as the original.

  2. Anonymous users2024-02-06

    If it is a SQL server, there is a mechanism such as read-ahead to improve the query efficiency of SQL Server, which means that the physical table is read into the system's cache synchronously when the execution plan is generated, which can reduce the IO. However, if the system runs for a long time, the larger the cache will be occupied, which will also affect the performance of the system. Of course, this is only one of the possibilities, and the specific situation needs to be analyzed on a case-by-case basis.

  3. Anonymous users2024-02-05

    It will also take time to turn on the data connection.

  4. Anonymous users2024-02-04

    Problem description The data of a table in the oracle database has been more than 100 million, and this table has created an independent index, due to business needs, it is necessary to insert 10,000 records into this table twice a day, due to the large amount of data, each insertion takes more than an hour, which seriously affects the efficiency, so the algorithm of the system is modified to store only the new records of the day in this table, and after the table is truncate, when the update operation on this table is executed the next day, it is very time-consuming, and when there are more than 100 million pieces of data in the table, this sql statement takes time in the second table When there are 10,000 pieces of data, this SQL statement takes several hours, and after consulting DBA, it is concluded that the index needs to be rebuilt, and this operation is completed in seconds, but the problem still appears on the third day, and DBA is looking for the reason. Is it necessary to rebuild the index every time the truncate table is rebuilt?

    For this problem, DBA does not give an explanation for the slag segment theory, and speculates that the main reason is Oracle's complex query optimization algorithm.

    The solution given by the final backup DBA.

    truncate table

    drop index

    insert data

    create index

    yze table table_name pute statistics;Newly generated stats for re-imitating Liang Tu.

    lishixinzhi/article/program/oracle/201311/16938

  5. Anonymous users2024-02-03

    This is a big problem, and a thick book could be written. It is advisable to read books on DBA and database optimization.

  6. Anonymous users2024-02-02

    Is it because the memory is not released in time during your use?

  7. Anonymous users2024-02-01

    That's because the data is too large to read and write, and the performance of your machine itself is insufficient, so if necessary, optimize the database, you can build fields and indexes.

  8. Anonymous users2024-01-31

    Restarting the machine is the best solution.

Related questions
25 answers2024-03-31

Your situation is the same as that of a colleague of mine, except that the role of my colleague is that girl, and in the end she succeeded. >>>More

8 answers2024-03-31

If you are sure that your hardware is okay with the system, it is estimated that you are infected with a virus, no matter how you reinstall the system, as long as you click on the programs in other disks, the virus will be activated and the computer will be reinfected. The first solution is to kill and kill, if this method is ineffective, the easiest and most thorough way to repartition, but your data will not be saved.

12 answers2024-03-31

Answer: 1 c 2 b 3 d 4 b 5 a Explanation: 1 From the first two sentences of the first paragraph. >>>More

13 answers2024-03-31

Ask your girlfriend's school or work, friends, family, there is always someone to know.

8 answers2024-03-31

The first method.

Here are some guidelines for making fertilizer for your home: >>>More