j*n
8 楼
帖个例子上来,俺给你瞧瞧?
beijing 是做orancle 的,你寻错人了,呵呵
往下看看我的帖子,一位给了我一本电子版的书,很好很强大。
beijing 是做orancle 的,你寻错人了,呵呵
往下看看我的帖子,一位给了我一本电子版的书,很好很强大。
j*n
9 楼
some rules for you to start
rule 1. avoid table scan... check your execution plan by hit ctrl+l
rule 2. avoid CASE...THEN... in select statement
rule 3. avoid NOT IN, NOT EXIST
rule 4. use INNER JOIN when possible instead of LEFT/RIGHT OUTER JOIN
rule 5. use UNION ALL when possible against UNION
rule 6. avoid function against columns in WHERE clause
rule 7. use ISNULL() instead of OR in WHERE clause
e.g. WHERE col1 = @var1 OR @var1 IS NULL
can be written to
WHERE col1
rule 1. avoid table scan... check your execution plan by hit ctrl+l
rule 2. avoid CASE...THEN... in select statement
rule 3. avoid NOT IN, NOT EXIST
rule 4. use INNER JOIN when possible instead of LEFT/RIGHT OUTER JOIN
rule 5. use UNION ALL when possible against UNION
rule 6. avoid function against columns in WHERE clause
rule 7. use ISNULL() instead of OR in WHERE clause
e.g. WHERE col1 = @var1 OR @var1 IS NULL
can be written to
WHERE col1
p*a
10 楼
I am a newbie too, curious to know?
what to use?
wha to use?
whay not coalesce?
【在 j*****n 的大作中提到】
: some rules for you to start
: rule 1. avoid table scan... check your execution plan by hit ctrl+l
: rule 2. avoid CASE...THEN... in select statement
: rule 3. avoid NOT IN, NOT EXIST
: rule 4. use INNER JOIN when possible instead of LEFT/RIGHT OUTER JOIN
: rule 5. use UNION ALL when possible against UNION
: rule 6. avoid function against columns in WHERE clause
: rule 7. use ISNULL() instead of OR in WHERE clause
: e.g. WHERE col1 = @var1 OR @var1 IS NULL
: can be written to
what to use?
wha to use?
whay not coalesce?
【在 j*****n 的大作中提到】
: some rules for you to start
: rule 1. avoid table scan... check your execution plan by hit ctrl+l
: rule 2. avoid CASE...THEN... in select statement
: rule 3. avoid NOT IN, NOT EXIST
: rule 4. use INNER JOIN when possible instead of LEFT/RIGHT OUTER JOIN
: rule 5. use UNION ALL when possible against UNION
: rule 6. avoid function against columns in WHERE clause
: rule 7. use ISNULL() instead of OR in WHERE clause
: e.g. WHERE col1 = @var1 OR @var1 IS NULL
: can be written to
B*g
13 楼
what to use?
wha to use?
whay not coalesce?
wha to use?
whay not coalesce?
B*g
14 楼
这个对新手足够了,你把整本书贴出来吧。
【在 j*****n 的大作中提到】
: some rules for you to start
: rule 1. avoid table scan... check your execution plan by hit ctrl+l
: rule 2. avoid CASE...THEN... in select statement
: rule 3. avoid NOT IN, NOT EXIST
: rule 4. use INNER JOIN when possible instead of LEFT/RIGHT OUTER JOIN
: rule 5. use UNION ALL when possible against UNION
: rule 6. avoid function against columns in WHERE clause
: rule 7. use ISNULL() instead of OR in WHERE clause
: e.g. WHERE col1 = @var1 OR @var1 IS NULL
: can be written to
【在 j*****n 的大作中提到】
: some rules for you to start
: rule 1. avoid table scan... check your execution plan by hit ctrl+l
: rule 2. avoid CASE...THEN... in select statement
: rule 3. avoid NOT IN, NOT EXIST
: rule 4. use INNER JOIN when possible instead of LEFT/RIGHT OUTER JOIN
: rule 5. use UNION ALL when possible against UNION
: rule 6. avoid function against columns in WHERE clause
: rule 7. use ISNULL() instead of OR in WHERE clause
: e.g. WHERE col1 = @var1 OR @var1 IS NULL
: can be written to
c*t
15 楼
good, should be marked
【在 j*****n 的大作中提到】
: some rules for you to start
: rule 1. avoid table scan... check your execution plan by hit ctrl+l
: rule 2. avoid CASE...THEN... in select statement
: rule 3. avoid NOT IN, NOT EXIST
: rule 4. use INNER JOIN when possible instead of LEFT/RIGHT OUTER JOIN
: rule 5. use UNION ALL when possible against UNION
: rule 6. avoid function against columns in WHERE clause
: rule 7. use ISNULL() instead of OR in WHERE clause
: e.g. WHERE col1 = @var1 OR @var1 IS NULL
: can be written to
【在 j*****n 的大作中提到】
: some rules for you to start
: rule 1. avoid table scan... check your execution plan by hit ctrl+l
: rule 2. avoid CASE...THEN... in select statement
: rule 3. avoid NOT IN, NOT EXIST
: rule 4. use INNER JOIN when possible instead of LEFT/RIGHT OUTER JOIN
: rule 5. use UNION ALL when possible against UNION
: rule 6. avoid function against columns in WHERE clause
: rule 7. use ISNULL() instead of OR in WHERE clause
: e.g. WHERE col1 = @var1 OR @var1 IS NULL
: can be written to
j*n
17 楼
http://www.mitbbs.com/article_t/Database/31138084.html
【在 c**t 的大作中提到】
: where is the e-Book? can you share?
【在 c**t 的大作中提到】
: where is the e-Book? can you share?
j*n
19 楼
rule 2. avoid CASE...THEN... in select statement
B*g
20 楼
wk,我竟然还会了这个帖子。没找到下载link
【在 j*****n 的大作中提到】
: http://www.mitbbs.com/article_t/Database/31138084.html
【在 j*****n 的大作中提到】
: http://www.mitbbs.com/article_t/Database/31138084.html
j*n
24 楼
嗯,这个比较麻烦,得看情况:
多少个 cpu,
多少 ram,
磁盘阵列/SAN 的连接情况,有几个 physical I/O path,
SQL Server 2k5 EE 的话还要考虑是否作 table partitioning,
32 bit 得考虑 AWE (Allocation Windowing Extensions)
数据库是用作 OLTP/OLAP,
OLTP 的话还得小心 clustered index,
建议先开一个 perfmon 看看, 找到bottle neck 再说其他。
【在 B*****g 的大作中提到】
: 人家要optimize sql server,不是tuning sql。
多少个 cpu,
多少 ram,
磁盘阵列/SAN 的连接情况,有几个 physical I/O path,
SQL Server 2k5 EE 的话还要考虑是否作 table partitioning,
32 bit 得考虑 AWE (Allocation Windowing Extensions)
数据库是用作 OLTP/OLAP,
OLTP 的话还得小心 clustered index,
建议先开一个 perfmon 看看, 找到bottle neck 再说其他。
【在 B*****g 的大作中提到】
: 人家要optimize sql server,不是tuning sql。
p*a
27 楼
STILL CONFUSED---
rule 2. avoid CASE...THEN... in select statement
rule 2. avoid CASE...THEN... in select statement
j*n
30 楼
***************************************************************
What is wrong with this:
select result=case when type like 'Dec%' then 1 else 0 end.....
what other better way can do the same?
***************************************************************
that's why I suggested that you need ask front-end to do this job...
or, if this query is frequently used, add one more column to handle it:
UPDATE table
SET newCol = 1
FROM table
WHERE type LIKE 'Dec%'
UPDATE table
SET newCol = 0
FROM table
W
What is wrong with this:
select result=case when type like 'Dec%' then 1 else 0 end.....
what other better way can do the same?
***************************************************************
that's why I suggested that you need ask front-end to do this job...
or, if this query is frequently used, add one more column to handle it:
UPDATE table
SET newCol = 1
FROM table
WHERE type LIKE 'Dec%'
UPDATE table
SET newCol = 0
FROM table
W
d*y
40 楼
哈,什么牛人总结的?挺对啊。
把OPTIMIZER的难点都列出来了。
把OPTIMIZER的难点都列出来了。
相关阅读
Any Chinese Tutorial for Access Programming?Pattern Match in Oraclewant help on RDBMSA questionlink and destroy the link in access 97如何做到?不可不看no guys care about data warehouse and data mining?谁有Transcender的SQL Admin 和Design软件给偶一个干活的机会,何如? 申请作Database板副can .pc and .c make difference?Re: [转载] what's the equivalent of 'minus' (oracle) in access?Re: Oracle DBAhow to update oracle view by delphisosBCP的问题一夜白头Versant vs. ObjectStore请问有关在NT下运行VB的水晶报表Re: Make your own dynamic page today数据库日志