boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Database版 - Which one is better?
相关主题
urgent help! insert value into table
请教2个sql query 问题
A sql question
再问not exist和not in
有人给大包子了
mySQL select 的速度与table的长度有关吗?
help about SQL for ACCESS
Which design is better?
About INSERT IGNORE
Help
相关话题的讨论汇总
话题: select话题: cost话题: better话题: choosecost
进入Database版参与讨论
1 (共1页)
B*****g
发帖数: 34098
1
why CHOOSECost for (1) is more than (2)?
SELECT *
FROM c
WHERE EXISTS (SELECT 1
FROM a
WHERE a.key = c.key
AND ROWNUM = 1)

Plan
SELECT STATEMENT CHOOSECost: 670,429 Bytes: 87,120,580 Cardinality: 215,
645
4 FILTER
1 TABLE ACCESS FULL C Cost: 23,494 Bytes: 87,120,580 Cardinality:
215,645
3 COUNT STOPKEY
2 INDEX RANGE SCAN UNIQUE INDEX1(***table A***) Cost: 3 B
c*****d
发帖数: 6045
2
2用了hash join,应该比1快
B*****g
发帖数: 34098
3
实际执行时间(total not cpu time),1 10秒, 2 2分钟。

【在 c*****d 的大作中提到】
: 2用了hash join,应该比1快
c*****d
发帖数: 6045
4
这两条语句返回多少记录?
如果很少,应该1快;如果很多,应该2快

【在 B*****g 的大作中提到】
: 实际执行时间(total not cpu time),1 10秒, 2 2分钟。
c*****d
发帖数: 6045
5
另外,不同语句的cost是没有可比性的

【在 B*****g 的大作中提到】
: 实际执行时间(total not cpu time),1 10秒, 2 2分钟。
s******e
发帖数: 493
6
The optimizer uses a mix of cost and heuristics to find a best plan for fast
delivery of the first row. Note: Using heuristics sometimes leads the CBO
to generate a plan with a cost that is significantly larger than the cost of
a plan without applying the heuristic.
I******e
发帖数: 101
7
Can you post the plan better readable? But, basically it is the statistics
issue.
1 (共1页)
进入Database版参与讨论
相关主题
Help
One Q for DB expert
How to use the SQL key word EXISTS?
求求!waiting online
有什么优化query的常用方法
How to write this query
more HELP: how to make this sql more efficient?
SQL 查询已经解决.谢谢Modeler,mirthc,cheungche
query running long time
error of sql query in MS Access database (转载)
相关话题的讨论汇总
话题: select话题: cost话题: better话题: choosecost