工作,学习,生活,这里将会有一些记录. 备用域名:http://meisw.51099.com 注册 | 登陆
浏览模式: 标准 | 列表2012年11月的文章

Copying to tmp table

MySQL may use temporary tables during query execution. Ideally you would want to avoid this, since its an expensive and slow operation. It can be avoided by optimizing queries. Sometimes it can’t be completely avoided – in that case you want to make sure the temporary table is created as a “memory” storage engine table, since its very fast, as it is never written to disk and remains, as the name states, in memory. But, as the manual explains, there are some conditions, such as TEXT/BLOB columns, or a combination of GROUP BY/ORDER BY clauses that makes MySQL write the temporary table to disk as a MyISAM table. One can spot these queries by the EXPLAIN output:
[...] Using where; Using temporary; Using filesort
In that case performance depends on disk I/O speed. If there are multiple similar queries running simultaneously, they try to read/write a lot of information to the disk, and will become extremely slow.

Solution? TMPFS!

tmpfs is a filesystem, that resides in RAM/Swap, so if your server has enough available RAM, files written there will bypass disk I/O completely, and will perform significantly faster.

Now, “High Performance MySQL, Second Edition” claims that this solution is still not as good as a MEMORY table, since it requires MySQL to use some expensive OS calls to write & read the temporary table, but it is still faster than the disk based temporary table.

To set it up, just mount a tmpfs system on an empty directory (you should also add this to fstab):
mount tmpfs /tmpfs -t tmpfs
and edit my.cnf to make MySQL use that directory as a temporary directory:
tmpdir = /tmpfs
Be careful though, there is a bug in some versions that prevents this from working properly.

For more information, see this blog.

xcache 与zend

在CentOS 6.2的64位系统里,xcache 3用不了,不生效

xcache 2.0.1可以用,但不与zend op3.3不兼容,无法同是使用

闭目养肝踮脚补肾 11个百病不侵方法

养肝大法就是闭眼睛

  人的神明,都可以从眼神耗出去。古代有一个养生大法:眼睛一闭,就养肝。因为“肝主藏血”,肝主目。比如眼睛干涩、眼睛迎风流泪,都是肝病,迎风流泪属于肝的收敛功能不足;眼睛干涩是肝的精血不足,所以养肝大法就是闭眼睛。

  闭目降气,食指轻压眼睑,微微揉搓到眼珠发热发胀,便觉得燥怒平息


转转眼球

  双目同时以远处某一大型固定物体为目标,由左经上方再至右到下方回到左方,眼动头不动,旋转运目10圈。然后再由右经上方至左到下方回到右侧,旋转运目10圈。有清除眼疲劳、提高视力的功效。

踮脚尖

  每日踮脚尖,补肾又养生。工作间隙做些转颈、前俯、后仰的头部运动,或用空拳轻轻叩击头部,不仅能解除颈部肌肉疲劳,还能改善大脑血氧供应,健脑提神,治疗由神经衰弱引起的失眠等。

摇头转颈

  工作间隙做些转颈、前俯、后仰的头部运动,或用空拳轻轻叩击头部,不仅能解除颈部肌肉疲劳,还能改善大脑血氧供应,健脑提神,治疗由神经衰弱引起的失眠等。

15~25岁需多吃白菜、韭菜、豆芽、瘦肉等豆类食品,使皮肤红润有弹性,尤其是豆类食物,既能满足人体需要的优质蛋白质,又能供给多种维生素和无机盐。

女人怕衰老,女人衰老的原因一是缺气,二是寒气、三是肾亏。每天早上三片生姜、一杯蜂蜜水、三颗红枣,两天一瓶酸奶,平时多吃亚足额、血猪血。

梳头

  各式梳子或手指皆可,每日梳数十至百下,具有按摩头皮,醒脑开窍的功效,对视力、听力也很有帮助。

  叩齿

  齿对齿轻叩,或牙齿空咬,可防止牙龈退化、牙周病等口腔问题;此法还可促进脸颊肌肉活动,使脸颊丰润,防止双颊下垂。

拍肩

  左手自然上甩拍右肩,右手拍左肩交替,也可用手掌自然交替拍腿。

  握拳

  双手紧握后放松,反复数回,直立或坐姿时均可进行。