- 1、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。。
- 2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 3、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
- 4、该文档为VIP文档,如果想要下载,成为VIP会员后,下载免费。
- 5、成为VIP后,下载本文档将扣除1次下载权益。下载后,不支持退款、换文档。如有疑问请联系我们。
- 6、成为VIP后,您将拥有八大权益,权益包括:VIP文档下载权益、阅读免打扰、文档格式转换、高级专利检索、专属身份标志、高级客服、多端互通、版权登记。
- 7、VIP文档为合作方或网友上传,每下载1次, 网站将根据用户上传文档的质量评分、类型等,对文档贡献者给予高额补贴、流量扶持。如果你也想贡献VIP文档。上传文档
查看更多
写出高效sql(Write efficient SQL)
写出高效sql(Write efficient SQL)
(1) select the most efficient table name order (valid only in the rule based optimizer):
The Oracle parser in accordance with the order from right to left with a table in the FROM clause, the FROM clause written at the end of the table (based on table driving table) will be processed first, in the FROM clause contains multiple tables, you must select the number of records at the table as the base table. If you have more than 3 tables connected to the query, you need to select the table (intersection) as the base table, which refers to the table referenced by other tables.
(2) the join order in the WHERE clause:
The Oracle sequence analysis of WHERE clause bottom-up, according to this principle, the connection between the tables must be written before the other end of the WHERE conditions, these conditions can filter out the maximum number of records that must be written in the WHERE clause.
(3) avoid using * in the SELECT clause:
In parsing, Oracle converts * into all column names, which is done by querying the data dictionary, which means taking more time.
(4) reduce the number of accesses to the database:
Oracle does a lot of work internally: parsing SQL statements, estimating index utilization, binding variables, reading data blocks, and so on.
(5) to reset the ARRAYSIZE parameter in SQL*Plus, SQL*Forms, and Pro*C, you can increase the amount of retrieved data per database access, with a recommended value of 200.
(6) use the DECODE function to reduce processing time:
Using the DECODE function, you can avoid repeated scans of the same record or repeated connections to the same table.
(7) integrating simple, unrelated database access:
If you have a few simple database query statements, you can integrate them into a query (even if there is no relationship between them).
(8) delete duplicate records:
The most efficient way to delete duplicate records (using the ROWID) example:
DELETE, FROM, EMP, WHERE, E.ROWID, E (SELECT, MIN (X.ROWID), F
您可能关注的文档
- 人不成熟的几大特征--海尔集团ceo张瑞敏演讲稿(Several major features of human immaturity -- Haier Group CEO Zhang Ruimin speech).doc
- 人事行政(Personnel administration).doc
- 亚洲销售女神徐鹤宁经典语录(Asian sales goddess Xu Hening classic quotations).doc
- 人们劳动的结晶,有关长城的诗歌(The crystallization of people's labor, about the Great Wall Poetry).doc
- 享老产业中国养生养老产业发展新概念(Enjoy the old industry new concept of Chinese health care industry development).doc
- 人事助理实习日记(Personnel assistant internship diary).doc
- 人们最初厌恶编程的10个原因(10 reasons people initially hated programming).doc
- 人体24小时使用手册(Manual for 24 hours of human use).doc
- 交易小将得讲话(The trader needs to talk).doc
- 人体24小时(Human body 24 hours).doc
- 写在大一新生入学时(When freshmen enter school).doc
- 写给大一新生(For freshman).doc
- 写给大学毕业新生的职业建议(A career proposal for a new college graduate).doc
- 写给女人的肺腑之言(To the woman's words from the bottom of the heart).doc
- 写读后感作文教案(Write composition teaching).doc
- 农业机械种类(Types of agricultural machinery).doc
- 农书-宋-陈敷(Nong Shu - Song - Chen Fu).doc
- 农产品企业如何做老大(How to make the boss of agricultural products enterprises).doc
- 农产品安全质量无公害蔬菜安全要求(Agricultural products; safety quality; non polluted vegetables; safety requirements).doc
- 农大公共关系在线作业答案(Agricultural University public relations online homework answer).doc
文档评论(0)