更新时间:2023-08-28 15:26:52
我设法自己解决了这个问题.我在数据中找到了一种模式,该模式使我可以将数据拆分为唯一的块,并在以后需要时对块进行计数.这样,我将数据库的大小减少了300倍.现在查询将在1秒内返回,并且非分块表(大表)的总数现在为1.2亿条记录.
I managed to solve it by myself. I found a pattern in the data, that allowed me to split the data into unique chunks and count the chunks later, when needed. This way I reduced the size of the database by 300 times. Now the queries return in 1 second and the total amount of the non-chunked table (the big table) is now 120mln records.