**Index is slowing down the selecting actions **
Description the problem:
Table size 30G, Ram size 16G
mysql> select * from program_access_log where program_id between 1 and 4000;
very slow
Try to select the top 500,000 records:
mysql> select * from program_access_log where id between 1 and 500000 and program_id between 1 and 4000;
still very slow
Analysis:
MySQL cann't put this 30G table into Ram, it will read them from disk:
mysql> select * from program_access_log where id between 1 and 500000 and program_id between 1 and 4000;
MySQL will select the program_id between 1 and 4000 out coz it's smaller then try to find id between 1 and 500000, however the id column didn't store as sorted, so MySQL will read them from disk.
Solutions:
1. Partition: split program_id into different partitions
2. Split tables: split table into smaller tables
3. select * from program_access_log where id between 1 and 500000 and program_id between 1 and 15000000;
分享到:
相关推荐
way that slower devices can communicate with the system without slowing down faster ones. To satisfy these requirements a serial bus is needed. A bus means specification for the connections, protocol,...
This shows no signs of slowing down as the second edition is published. In fact, there is a new phenomenon known as “JavaScript fatigue” that is used to describe the unrelenting barrage of new ...
Since the queue grows when all the users are transmitting, the fraction of time during which the queue grows (which is equal to the probability that all three users are transmitting simultaneously)...
this is the first edition that can claim to be complete, even though several topics are not included and Xamarin.Forms continues to be progressively enhanced with no sign of slowing down.
Today’s JavaScript libraries are able to produce, together with the modern Internet browsers, a sufficient number of elements to the screen without slowing down. Best libraries are also able to ...
displacement mutation when shocking → constantly slowing down after earthquake: (ⅱ) The area of the strongest deformation and ground rupture was a low-lying oval depression region to the southeast....
Daubechies has a real knack for making the material appealing and lively, and there is a definite 'slowing down for details' at the points that require further elucidation . . . This book can be used...
Fixed an issue that was slowing down pasteboard-based file transfers if the files originated from a local network share. Addressed a bug that was causing to Excel (running in a remote session) to hang...
Developing-Android-Apps-course ...Lesson 1 - Creating Project Sunshine - Learn how to create and run a simple ...- Learn about threading and how to make requests without slowing down your app - Learn how t
This is an Arduion based NES controller for ... There do seem to be some issues with my phone slowing down while I'm using it, not sure if that's because of debug code or memory leak or something else. I
Combating Spyware in the Enterprise is the first book published on defending enterprise networks from increasingly sophisticated and malicious spyware. Combating Spyware in the Enterprise begins by ...
The efficiency of the Zeeman slower is shown to be dependent on the intensity and frequency detuning of the laser light for slowing the atoms. With the help of numerical analysis, optimal ...
Fixed an issue that was slowing down pasteboard-based file transfers if the files originated from a local network share. Addressed a bug that was causing to Excel (running in a remote session) to hang...
Since Lego launched Lego Mindstorms in late 1998 sales have skyrocketed - with no sign of slowing down. Mindstorms have captured the imagination of adults and children alike, creating a subculture of...
Moore’s Law slowing the pace of improvements due to scaling, Patterson describes how this slowdown is actually rejuvenating innovation in computer architectures, as future performance improvements ...
Your mouse is slowing you down. The time you spend context switching between your editor and your consoles eats away at your productivity. Take control of your environment with tmux, a terminal ...
You don't have to worry about questions slowing you down. Get fast and professional help while using our tools with Premium support. From our 24-hour support response guarantee to our knowledge-rich ...
You don't have to worry about questions slowing you down. Get fast and professional help while using our tools with Premium support. From our 24-hour support response guarantee to our knowledge-rich ...
Critical slowing down for LD/PIN bistable optical semiconductors and the critical slowing down exponents for this system have been investigated experimentally. The experimental value r-0.53, is ...
You don't have to worry about questions slowing you down. Get fast and professional help while using our tools with Premium support. From our 24-hour support response guarantee to our knowledge-rich ...