如何优化MySQL insert性能

piaoling  2012-10-30 13:34:42

来源:tigernorth 的博客 对于一些数据量较大的系统,面临的问题除了是查询效率低下,还有一个很重要的问题就是插入时间长。我们就有一个业务系统,每天的数据导入需要4-5个钟。这种费时的操作其实是很有风险的,假设程序出了问题,想重跑操作那是一件痛苦的事情。因此,提高大数据量系统的MySQL insert效率是很有必要的。 经过对MySQL的测试,发现一些可以提高insert效率的方法,供大家参考参考。 1. 一条SQL语句插入多条数据。 常用的插入语句如: INSERT ......

类别 :  Mysql(6)  |  浏览(5716)  |  评论(0)

Magento Eav Collection Bug

piaoling  2012-10-26 10:53:40

When product attribute has no default value, but in a specific store level or website level the attribute has value. When get Product Collection with the store level, it will not get the value. bug in: Mage_Catalog_Model_Resource_Eav_Mysql4_Collection_Abstract :: _getLoadAttributesSelect() $select = $this->getConnection()->select() ->from(array('default'=>$table), array($entityIdField, 'attribute_id', 'default_value'=>'value')) ->joinLeft( array('store'=>$table), ......

类别 :  magento(258)  |  浏览(5720)  |  评论(0)

test

piaoling  2012-10-25 16:45:02

SELECT `default`.`entity_id`, `default`.`attribute_id`, `default`.`value` AS `default_value`, `store`.`value` AS `store_value`, IF(store.value_id>0, store.value, default.value) AS `value` FROM `catalog_product_entity_varchar` AS `default` LEFT JOIN `catalog_product_entity_varchar` AS `store` ON store.attribute_id=default.attribute_id AND store.entity_id=default.entity_id AND store.store_id=2 WHERE (default.entity_type_id=4) AND (default.entity_id in (866)) AND (default.attribute_id in ('60', '75', '76', '86', '100', ......

类别 :  默认(760)  |  浏览(4094)  |  评论(0)

Test of modules

piaoling  2012-10-25 10:44:16

1,Out Bannaer Test(all of these case should be tested with multiple browsers:IE versions, Firefox ,Chrome) Set images for homepage,catalog page,product page to see whether it can dispaly normally. Set big images for homepage,catalog page,product page to see whether it can dispaly normally. Set small images for homepage,catalog page,product page to see whether it can dispaly normally. See specail page such as checkout page to see whether it dispaly: it should not display. Disable the images status to see whether id display or not:it should not display. Set M......

类别 :  工作(23)  |  浏览(4849)  |  评论(0)

Magento collection print query

piaoling  2012-10-23 09:30:20

Varien_Data_Collection_Db::load($print=false,$log=false)......

类别 :  magento(258)  |  浏览(5487)  |  评论(0)

单向成年人

piaoling  2012-10-22 13:20:19

最近常有跑步,难免在汗水之余想起一种生物,他学富五车才高八斗,基本特征是看破红尘俗世,却依然在这红尘里摸爬滚打披荆斩棘,人世间的世态炎凉, 办公司的尔虞我诈,现实社会的洪水猛兽,大多光怪陆离都从他们的口里得知,他们通晓人情世、处事八面玲珑…..我们一般称之为成年人。 并不是说成年人不好,也没想要妖魔化他们,不过的的确确有一些恶心的成年人,主要扮演的角色是信号放大器,把本已残酷的社会放大得更加的不堪,还兼 具二极管特性......

类别 :  默认(760)  |  浏览(4679)  |  评论(0)

没有过去的男人

piaoling  2012-10-18 13:31:26

作者:不二飞 这是我喜欢的一位歌手最新出版的一本书的书名。偶尔,我还能哼出几句他那首我很喜欢的歌:有一个你知道的人来了又去了。 我是会因为一句歌词买下一盘cd,又会因为一段文字扔掉整本书的人。而我现在想说的想做的和这些都没关。 很久没有写日记了,这也是真的。我当初买域名,买空间,捣鼓wp,就是想有一个我自己觉得界面漂亮干净能让我随心所欲打理的地方,安安静静的写些东西,记录一些琐碎和喃喃自语。很显然,我还是没有养成写日记的习惯......

类别 :  感悟(15)  |  浏览(5728)  |  评论(0)

magento image resize

piaoling  2012-10-18 00:53:26

       $filename ='F:/wamp/www/connection/style/theme/article-bottom-orig.png';         $processor = new Varien_Image($filename);                  $processor->keepAspectRatio(false);//保持高宽比         $processor->keepFrame(false);//保持帧         $processor->keepTransparency(true);//保持透明度         $processor->constrainOn......

类别 :  magento(258)  |  浏览(5964)  |  评论(0)

new blog bg--

piaoling  2012-10-17 17:50:08

bg body color:#927A5F input: background: url("input_bg.png") repeat-x scroll left top #F1E9DB;     border: 1px solid #816D45; http://vectormill.com/blogs/news/5839158-2012-vector-mill-update?comment=33307544#comments ......

类别 :  默认(760)  |  浏览(4833)  |  评论(0)

js中替换字符串

piaoling  2012-10-16 13:52:29

function formatStr(str) { str=str.replace(/\r\n/ig,"<br/>"); return str; } 要注意两点: 要使用正则表达式,不能使用 str.replace("\r\n", newString); ,这会导致只替换第一个匹配的子字符串。 母字符串中不一定 \r\n 会同时存在,也许只有 \n,没有 \r 也是可能的。 replace 方法的语法是:stringObj.replace(rgExp, replaceText) 其中stringObj是字符串(string),reExp可以是正则表达式对象(RegExp)也可以是字符串 (string),replaceText是替代查找到的字符串。。为了帮助大家更好的理解,下面举个简单例子说明一下 ......

类别 :  JS(21)  |  浏览(5744)  |  评论(0)
  • Page:17/146  1460 Blogs
    <<
    >>
    20088
    周日 周一 周二 周三 周四 周五 周六

    文章分类