美文网首页
Sybase开发的just do it和far away fro

Sybase开发的just do it和far away fro

作者: 扁圆柱体 | 来源:发表于2015-07-21 12:36 被阅读42次

    YES - Just Do It

    Design

    1. Should exist unique index for replication table.
    2. Object name must be same as file name(*.sp).
    3. Know which DB to put new object, CIS, DW_PROD or MySQL.
    4. Know which DB design guideline should be covered in new object.
    5. Know how is new table maintained. GUI, Q-Gen, Cron or others.
    6. Know whether new table need replication.
    7. Know how to maintain or archive the history data for new table.
    8. Name new object(table, colum, index, lock and PK/FK etc.) under naming convention.

    Develop

    1. Know process IO limit on CORP(1M) and DWS(5M)
    2. Tempdb is is only as your last resort.
    3. Code under SQL 92 standard.
    4. Use 'Poor Man's T-SQL Formatter' to format whole code instead of changed pieces.
    5. Use 'UNION' statement, or #temp table instead of big 'OR' statement.
    6. Use function % on loop column.
    7. Introduce an identity column if while-loop is on a #temp table.
    8. Prefix with 'adhoc_' and add ad-hoc# column on temperary table in Ad-hoc.
    9. Put the filter conditions on the outer table to 'ON' clause in outer join case.
    10. Remove unnecessary table join.
    11. Use #temp or perm temporary table to keep intermediate data.
    12. Use having clause to filter conditions after the aggregation takes place.
    13. Don't use rowcount setting if exist trigger.

    Deploy

    1. Know which database and server is affected in your Ad-hoc.
    2. Know what rows are affected in your Ad-hoc.
    3. Know whether table you mention in your Ad-hoc is hot.
    4. Know whether table you mention in your Ad-hoc has trigger.
    5. Know which target server should be deployed.
    6. Know what dependency exist in new object.
    7. Submit separate DDLs for schema change.
    8. Add 'grant right' statements in procedure deployed to DWS.
    9. Know our IT process regarding JDDL.

    NO - Far Away From

    Design

    1. Don't use smallint type in table design.
    2. Don't add clustered index on identity column.
    3. Don't allow null on unique and clustered index keys.
    4. Don't name table and column with 'rs_xxx'.
    5. Don't include 'sp' in the object name.
    6. Don't design one procedure which is called more frequency.
    7. Don't design new object whose function can be found in existed procedure.
    8. Don't change table schema before evaluating impact.

    Develop

    1. Don't create long DB transaction.
    2. Don't create large SQL text.
    3. Don't bring table scan in show plan for large table such as order_header and order_detail.
    4. Don't exist infinite while-loop.
    5. Don't use too many temp table and useless indexes.
    6. Don't create too many #temp table in procedure.
    7. Don't operate #temp table frequently such as insert or delete.
    8. Don't use '<> null' or '= null'.
    9. Don't abuse while -loop.
    10. Don't loop column without step-one-increase character such as sku#.
    11. Don't change any CIS data in DW_PROD procedure.
    12. Don't add 'go' statement in procedure body.
    13. Don't function on index keys in where clause.
    14. Don't mix min() and max() function on an indexed column in one statement.
    15. Don't create index on #temp table in a perf-sensitive and hot procedure.

    相关文章

      网友评论

          本文标题:Sybase开发的just do it和far away fro

          本文链接:https://www.haomeiwen.com/subject/xtypqttx.html