`
darrenzhu
  • 浏览: 797308 次
  • 性别: Icon_minigender_1
  • 来自: 上海
社区版块
存档分类
最新评论

Sybase性能调优建议清单

阅读更多
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
  • 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?

分享到:
评论

相关推荐

    sybase性能调优

    ### Sybase性能调优知识点详解 #### 一、概述 Sybase是一种高性能的企业级数据库管理系统,在许多企业级应用中有着广泛的应用。随着业务量的增长,系统可能会遇到性能瓶颈,因此进行有效的性能调优是非常必要的。...

    Sybase性能调优手册

    《Sybase性能调优手册》是一份针对Sybase 12.5版本的数据库系统进行性能优化的专业指导手册。Sybase Adaptive Server Enterprise (ASE),作为一款高性能的企业级数据库管理系统,其性能调优对于确保数据库系统的稳定...

    sybaseIQ性能调优资料

    下面,我们将深入探讨“sybaseIQ性能调优”这一主题,主要基于提供的文档名称,如“sybaseIQ性能优化.doc”和“SybaseIQ性能调优.doc”。 1. **理解Sybase IQ架构**:Sybase IQ采用列式存储方式,这使得对大量数据...

    Sybase数据库性能调优

    数据库性能一般用两个方面的指标来衡量:响应时间和吞吐量。响应越快,吞吐量越大,数据库性能越好。响应时间和吞吐量有些情况下不能一起得到改善。

    SybaseASE性能调优系列中文版

    调优性能 .......................................................................................... 3 调优级别 ................................................................................... 4 ...

    sybase系统性能调优方案

    详细介绍sybase调优的方法。从内存(cache)配置和锁机制详细阐述性能调优的原理、方法和步骤。

    SYBASE ASE性能调优

    ### SYBASE ASE 性能调优详解 #### 一、性能定义及度量方法 **性能**是指在特定环境中衡量应用程序或系统的效率。对于Sybase Adaptive Server Enterprise (ASE) 来说,性能主要包括两个方面: 1. **响应时间**:...

    sybase数据库性能调优原理

    sybase数据库性能调优原理介绍 系列ppt之一

    浅析Sybase数据库系统性能调优

    ### Sybase数据库系统性能调优分析 在当前信息化高速发展的时代背景下,数据库系统作为企业核心应用的基础支撑之一,其性能的高低直接影响到企业的业务效率与用户体验。Sybase数据库作为一种广泛应用于金融、电信等...

    Sybase ASE 调优手册3

    《Sybase ASE 调优手册3》是针对Sybase Adaptive Server Enterprise(ASE)数据库系统进行性能优化的专业指南。ASE是Sybase公司的一款高性能的关系型数据库管理系统,广泛应用于企业级应用,尤其在金融、电信等领域...

    Sybase ASE 调优手册2

    《Sybase ASE 调优手册2》是针对Sybase Adaptive Server Enterprise(ASE)数据库系统的一本专业参考资料,旨在帮助数据库管理员和开发人员优化数据库性能,提升系统效率。ASE是Sybase公司推出的企业级关系型数据库...

    Sybase数据库系统性能调优.doc

    《Sybase数据库系统性能调优》 Sybase数据库性能调优是提升系统效率的关键环节,其目标在于降低对系统公共资源的争夺,确保系统的稳定高效运行。优化工作主要涉及四个层次:服务器层、数据库层、应用层和运行环境层...

    浅析Sybase数据库系统性能调优.doc

    Sybase数据库系统的性能调优是一个复杂而重要的任务,旨在减少系统资源的争用,提升整体运行效率。这个过程涵盖了多个层次,包括服务器层、数据库层、应用层以及运行环境层。 1. **服务器层优化** - **内存分配**...

    SYBASE性能及调优指南 Volume 3

    ### SYBASE性能及调优指南 Volume 3 #### 第三卷:监控和分析性能工具 在本卷中,我们将深入探讨SYBASE数据库系统的性能监控与分析技术。这不仅包括了如何获取关键的统计信息,还涵盖了如何利用这些信息来监控并...

    SYBASE性能及调优指南 Volume 1

    ### SYBASE性能及调优指南 Volume 1 #### 基础知识篇 在深入了解Adaptive Server中的性能问题之前,我们需要掌握一系列的基础知识。这部分内容将帮助我们更好地理解数据库性能优化的基本概念和技术。 ##### 一、...

    Sybase iq12.6性能调优手册

    ### Sybase IQ 12.6 性能调优手册知识点详析 #### 一、引言 在数据库管理系统(DBMS)领域中,Sybase IQ 是一款高性能、面向列的数据库系统,以其卓越的数据处理能力和高效的数据压缩技术著称。Sybase IQ 12.6 ...

    sybase ASE15性能调优(1)

    ### Sybase ASE15 性能调优基本概念与实践 #### 一、数据库性能调优的基本概念 ##### 1.1 什么是性能 - **定义**:性能是指在特定环境下,应用程序或系统的运行效率。这包括单个应用程序的运行效率,以及多个应用...

    Sybase ASE数据库性能调优.pdf

    ### Sybase ASE数据库性能调优知识点详解 #### 一、概览 - **标题与描述**: “Sybase ASE数据库性能调优”旨在介绍如何优化Sybase Adaptive Server Enterprise (ASE) 数据库系统的性能,以实现更高效的数据管理和...

    Sybase IQ 性能调优Server和数据库调优VPPT学习教案.pptx

    【Sybase IQ 性能调优】 Sybase IQ 是一种高效的数据仓库和分析数据库系统,其性能调优是确保系统高效运行的关键环节。本教程主要涵盖以下几个方面: 1. **性能调优的基本理论**: - 理解性能调优的重要性,包括...

Global site tag (gtag.js) - Google Analytics