`
xxd
  • 浏览: 21222 次
  • 性别: Icon_minigender_1
  • 来自: 北京
最近访客 更多访客>>
文章分类
社区版块
存档分类
最新评论

MySQL Index is slowing down the selecting actions

阅读更多
**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;
分享到:
评论

相关推荐

    I2C BUS SPEC

    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,...

    JavaScript_Novice to Ninja, 2nd Edition-SitePoint(2017).pdf

    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)...

    “Microsoft_Press_eBook_CreatingMobileAppswithXamarinForms_PDF”.pdf

    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.

    presenting big data with interactive data

    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 ...

    Processes of the Displacement Field

    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...

    Microsoft Remote Desktop for Mac Version 10.2.2 (1268)

    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...

    Android代码-Android应用程序开发例子

    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

    Android代码-android-arduino-nes-controller

    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(syngress安全图书)

    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 ...

    Zeeman slowing atoms using the magnetic field from a magneto-optical trap

    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 ...

    Microsoft Remote Desktop for Mac

    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...

    Building Robots with LEGO MINDSTORMS(syngress安全图书)

    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...

    isscc2018第一章的详细ppt

    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 ...

    tmux.2.Productive.Mouse-Free.Development.epub

    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 ...

    ComponentOne Studio for Compact Framework2012 v3 2/2

    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 ...

    ComponentOne Studio for Compact Framework2012 v3 1/2

    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 ...

    LD/PIN光学双稳半导体激光器的临界慢变效应和临界指数

    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 ...

    ComponentOne Studio for ActiveX 2012 v3 1/4

    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 ...

Global site tag (gtag.js) - Google Analytics