Get the App
SLTechnology News&Howtos  ›  Database  › 

What are the sql specifications?

Shulou Source: shulou.com Published: 2022-05-31 12:35:51 11月15日 Update

This article mainly shows you "what are the sql specifications", the content is easy to understand, clear, hope to help you solve your doubts, the following let the editor lead you to study and learn "what are the sql specifications" this article?

See the Wechat post from itpub, move it, it should not belong to optimization, it should belong to the basic sql specification:

The 1.ORACLE parser processes the table names in the from clause from right to left, so the table written later (the underlying table driving table) will be processed first, choosing the one with the least number of records as the driving table

two。 Table joins are written before other where conditions. You can filter out the conditions most recorded by big data and write them at the end of the where sentence.

Avoid using * in 3.select sentences

4. Set ARRAYSIZE to increase the amount of data retrieved per database access. 200 is recommended.

Show arraysize

Set arraysize 200

Permanent: this parameter can be saved to a glogin.sql or login.sql file, so it can take effect permanently without having to specify it in set every time.

5. Use the decode function to reduce processing time

6. Easy to integrate, unrelated database access

7. Delete duplicate records:

Delete from emp a where a.rowid > (select min (x.rowid))

8.truncate replaces delete

9. Be sure to remember commit, multi-commit:

Release the data information of the undo segment for recovery

Release lock

Free up redo log buffer space

10. Improve sql efficiency through internal functions

11. Use the alias of the table

twelve。 Replace in,not exists with exists instead of not in

13. Be good at using indexes

14.sql statement case specification, in uppercase

15. Avoid using not and calculations on indexes

16. Replace > with > =

17. Replace index columns with union replace or with union in the or:where sentence (insist on using or, write the index column with the least number of records at the front)

18. Avoid resource-consuming operations: distinct,union,minus,intersect,order by

These are all the contents of the article "what are the sql specifications?" Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Tags: Data index content sentence article processing function database condition permanent learning help maximum middle use information alias parameter basic uppercase size Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno MariaDB Xiaomi Linux Redmi macOS