- 浏览: 815813 次
- 性别:
- 来自: 上海
-
文章分类
- 全部博客 (360)
- Java (101)
- JPA/Hibernate (10)
- Spring (14)
- Flex/BlazeDS (37)
- Database (30)
- Lucene/Solr/Nutch (0)
- Maven/Ant (25)
- CXF/WebService (3)
- RPC/RMI/SOAP/WSDL (1)
- REST (6)
- TDD/BDD/JUnit (1)
- Servlet/JSP (2)
- AI/MachineLearning (3)
- Resource (1)
- 字符编码 (2)
- OOA/OOPS/UML (5)
- DesignPattern (8)
- 算法与数据结构 (11)
- Web&App Server (13)
- 并发&异步&无阻塞 (7)
- Entertainment (4)
- JavaScript/ExtJS (45)
- CodeStyle&Quality (1)
- svn/git/perforce (8)
- JSON (2)
- JavaScriptTesting (4)
- Others (6)
- RegularExpression (2)
- Linux/Windows (12)
- Protocal (2)
- Celebrities (1)
- Interview (1)
- 计算机语言 (1)
- English (2)
- Eclipse (5)
- TimeZone/时区 (1)
- Finance (1)
- 信息安全 (1)
- JMS/MQ (2)
- XSD/XML/DTD (3)
- Android (4)
- 投资 (3)
- Distribution (3)
- Excel (1)
最新评论
-
qdujunjie:
如果把m换成具体的数字,比如4或者5,会让读者更明白
m阶B树中“阶”的含义 -
java-admin:
不错,加油,多写点文章
关于Extjs的mixins和plugin -
xiehuaidong880827:
你好,我用sencha cmd打包完本地工程后,把app.js ...
ExtJS使用Sencha Cmd合并javascript文件为一个文件 -
KIWIFLY:
lwpan 写道inverse = "true&qu ...
Hibernate中什么时候使用inverse=true -
luedipiaofeng:
good
消除IE stop running this script弹出框
http://stackoverflow.com/questions/18783/favourite-performance-tuning-tricks
Here is the handy-dandy list of things I always give to someone asking me about optimisation.
We mainly use Sybase, but most of the advice will apply across the board.
SQL Server, for example, comes with a host of performance monitoring / tuning bits, but if you don't have anything like that (and maybe even if you do) then I would consider the following...
99% of problems I have seen are caused by putting too many tables in a join. The fix for this is to do half the join (with some of the tables) and cache the results in a temporary table. Then do the rest of the query joining on that temporary table.
Query Optimisation Checklist
Here is the handy-dandy list of things I always give to someone asking me about optimisation.
We mainly use Sybase, but most of the advice will apply across the board.
SQL Server, for example, comes with a host of performance monitoring / tuning bits, but if you don't have anything like that (and maybe even if you do) then I would consider the following...
99% of problems I have seen are caused by putting too many tables in a join. The fix for this is to do half the join (with some of the tables) and cache the results in a temporary table. Then do the rest of the query joining on that temporary table.
Query Optimisation Checklist
- Run UPDATE STATISTICS on the underlying tables
- Many systems run this as a scheduled weekly job
- Delete records from underlying tables (possibly archive the deleted records)
- Consider doing this automatically once a day or once a week.
- Rebuild Indexes
- Rebuild Tables (bcp data out/in)
- Dump / Reload the database (drastic, but might fix corruption)
- Build new, more appropriate index
- Run DBCC to see if there is possible corruption in the database
- Locks / Deadlocks
- Ensure no other processes running in database
- Especially DBCC
- Are you using row or page level locking?
- Lock the tables exclusively before starting the query
- Check that all processes are accessing tables in the same order
- Are indices being used appropriately?
- Joins will only use index if both expressions are exactly the same data type
- Index will only be used if the first field(s) on the index are matched in the query
- Are clustered indices used where appropriate?
- range data
- WHERE field between value1 and value2
- Small Joins are Nice Joins
- By default the optimiser will only consider the tables 4 at a time.
- This means that in joins with more than 4 tables, it has a good chance of choosing a non-optimal query plan
- Break up the Join
- Can you break up the join?
- Pre-select foreign keys into a temporary table
- Do half the join and put results in a temporary table
- Are you using the right kind of temporary table?
- #temp tables may perform much better than @table variables with large volumes (thousands of rows).
- Maintain Summary Tables
- Build with triggers on the underlying tables
- Build daily / hourly / etc.
- Build ad-hoc
- Build incrementally or teardown / rebuild
- See what the query plan is with SET SHOWPLAN ON
- See what’s actually happenning with SET STATS IO ON
- Force an index using the pragma: (index: myindex)
- Force the table order using SET FORCEPLAN ON
- Parameter Sniffing:
- Break Stored Procedure into 2
- call proc2 from proc1
- allows optimiser to choose index in proc2 if @parameter has been changed by proc1
- Can you improve your hardware?
- What time are you running? Is there a quieter time?
- Is Replication Server (or other non-stop process) running? Can you suspend it? Run it eg. hourly?
发表评论
-
mysql,oracle,sql server中的默认事务隔离级别
2018-08-02 17:03 728mysql,oracle,sql server中的默认事务隔离 ... -
创建前缀索引报长度超出错误
2018-07-25 15:44 1774表结构定义如下: CREATE TABLE `sku` ( ` ... -
Mysql Varchar字符长度
2018-07-25 15:23 1383`sku_name` VARCHAR(200) NOT NUL ... -
Mysql分表和分区的区别、分库分表介绍与区别
2017-06-14 20:32 1911Mysql分表和分区的区别、分库分表介绍与区别 http:// ... -
Nested Loop Join和子查询
2017-06-03 20:56 762这2个是不同的概念,不要混淆在一起了 Nested Loop ... -
oracle中rownum和rowid的区别
2017-06-03 20:55 1033oracle中rownum和rowid的区 ... -
分布式事务XA,JTA,两阶段提交,BASE
2016-06-27 21:45 5718关于分布式事务、两阶段提交、一阶段提交、Best Effort ... -
大数据技能图谱
2016-03-24 13:33 900http://mp.weixin.qq.com/s?__biz ... -
Java 方法(JdbcTransactionTemplate)与存储过程共享同一个事务
2016-01-12 19:24 1746如果要让java来管理事务,那么在存储过程里不能写提交(com ... -
Java 平台开发有效事务策略,数据库事务性能
2016-01-11 15:42 900Java 平台开发有效事务策略系列文章 http://www. ... -
SQL语句的where字句表达式顺序影响性能吗?
2015-09-09 13:45 1997比如下面的SQL语句性能有区别吗? select * from ... -
Sybase database Transaction mode: chained and unchained
2015-09-02 10:15 1482Support for Sybase database Tra ... -
聚集索引,非聚集索引,主键,索引类型及实现方式
2015-08-06 11:31 851聚集索引和非聚集索引(整理) http://www.cnblo ... -
Sybase SQL性能诊断
2015-03-17 11:19 1721Performance and Tuning Series: ... -
left join时on条件与where条件的区别
2015-03-09 17:46 3463参考文章:http://cqujsjcyj.iteye.com ... -
Sybase常用命令,SQL语句
2014-10-22 16:44 5050SQL online sample http://sqlzoo ... -
数据库系统基本概念
2014-07-02 18:47 1414数据模型(Data Model)是描述数据、数据联系、数据语义 ... -
乐观锁与悲观锁
2014-06-09 11:57 688Key points: 悲观锁的实现,往往依靠数据库提供的锁机 ... -
数据库事务,锁,隔离级别(Isolation Level)
2014-06-09 11:44 2233数据库的隔离级别2(repeaable read)可实现重 ... -
我的Oracle学习笔记
2014-05-18 13:31 0以前工作中整理的oracle学习笔记,虽然有些凌乱,但是时候自 ...
相关推荐
了解Sybase ASE的性能调优机制可以帮助提高迁移后系统的整体性能。 #### 四、数据与SQL迁移 ##### 4.1 迁移数据 迁移数据时需要注意的关键点包括数据类型的映射、数据转换规则等。 ##### 4.2 迁移SQL应用代码 ...
为了确保新系统能够在生产环境中稳定高效地运行,还需要进行性能调优。这包括: - **索引优化**:根据查询模式和数据分布来优化索引。 - **查询优化**:分析慢查询日志,对性能瓶颈进行定位并优化。 - **资源分配**...
包括索引优化、查询优化等基本调优技巧,帮助提升性能。 ##### 3.13 其他管理员任务 还包括监控工具的使用、空间管理、事务跟踪等日常管理任务。 #### 四、管理差异 从MySQL迁移到Sybase ASE的过程中,还需要...
Sybase ASE 15.7 开发文档:系统管理指南(卷二)共两卷 第 1 章 限制对服务器资源的访问 第 2 章 镜像数据库设备 第 3 章 配置内存 第 4 章 配置数据高速缓存 第 5 章 管理多处理器服务器 第 6 章 创建和管理用户...
此外,还会有专门的章节讲解性能调优,包括查询优化、内存管理和数据库参数调整。 对于开发者来说,接口和API的使用至关重要。书中会详细介绍如何使用SQL Anywhere提供的SDK,如JDBC、ODBC和ADO.NET,进行客户端...