Database
jyfhsszq
这个作者很懒,什么都没留下…
展开
-
How to find the root cause of performance for SQL
1.Duplicate运行慢的场景,并重新运行这个场景2.用工具db2mon.exe或者其他方式监控正在运行的sql,找出一直在excuting 的sql 这个或这些sql是导致运行慢的原因,尝试优化sql来解决问题。3.用Execute plan来分析sql在哪一部份的cost最高,然后对这一步进行优化4.For step 3, we first use reorgchk c...2010-09-15 11:01:06 · 80 阅读 · 0 评论 -
如何提高SQL性能
1. 如果有or出现, 有可能影响性能,因为or可能让索引无效, 用union all 把or分成两个sql, 这样保证其中一个或者两个都可以用到索引.原创 2010-09-20 22:04:55 · 97 阅读 · 0 评论 -
一些有用的DB2命令
1.在命令行执行长的SQLdb2 connect to $dbname 后使用 db2 -tf 文件名 进行执行原创 2010-09-22 21:24:47 · 213 阅读 · 0 评论 -
How to find the root cause of performance for stored procedure
1. Add log for the sp and find which step has the high cost.2. If the step is static sql use <<How to find the root cause of performance for SQL>> to found the root cause.3. If the ste...原创 2010-09-24 10:05:29 · 93 阅读 · 0 评论 -
MySQL命令收藏
1.查看数据库版本mysql> SELECT @@version; 2.连接远程DBmysql h[IP address] u[User Name] p[password] 3.选择或者切换DBmysql> use [DB Name] 4.备份数据库(backup database)mysqldump -u root -p[password]...原创 2015-04-08 19:03:52 · 86 阅读 · 0 评论 -
Mysql sum的性能优化
对sum的列加索引,的确能够提高性能。经过在千万级数据量上测试,性能从8秒提高到了1秒以内。具体可参考:https://www.cnblogs.com/sunss/archive/2010/10/30/1864949.html...转载 2019-07-23 17:49:20 · 13831 阅读 · 0 评论