SQL Coding Guidelines
For SQL make particular note of the concepts behind SmartDB/PinkDB
SQL Coding Guidelines
SQL Coding Guidelines
Don't SELECT * unless you really need all columns (1)
Update Only What Needs Updating
Disable Constraints and Indexes During Bulk Loads
Use UNLOGGED Tables for Intermediate Data
Implement Complete Processes Using WITH and RETURNING
Avoid Indexes on Columns With Low Selectivity
Use Partial Indexes
Always Load Sorted Data
Index Columns With High Correlation Using BRIN
Make Indexes "Invisible"
Don't Schedule Long Running Processes at Round Hours
Consider using a timestamp instead of a boolean (2)
Enclose comments (e.g. use /* comment */ instead of -- comment) (3)
Consider SmartDB/PinkDB.. especially for cloud, especially for chatty apps
Use as few engine-specific hints as possible in your queries (4)
Bibliography & References
Bibliography & References
https://www.sqlstyle.guide/https://www.simonholywell.com/post/2016/12/sql-style-guide-misconceptionshttps://www.brentozar.com/archive/2021/05/signs-your-t-sql-might-fail-a-code-review/(1) https://tanelpoder.com/posts/reasons-why-select-star-is-bad-for-sql-performance/(2) https://changelog.com/posts/you-might-as-well-timestamp-it(3) https://www.brentozar.com/archive/2021/04/never-ever-ever-start-t-sql-comments-with-two-dashes/(4) https://www.brentozar.com/archive/2022/05/dont-treat-sql-like-a-programming-or-scripting-language/Â
File extensions for SQL Codehttps://forums.oracle.com/ords/apexds/post/oracle-files-which-file-extension-is-proper-sql-or-pls-and-7393
File extensions for SQL Codehttps://forums.oracle.com/ords/apexds/post/oracle-files-which-file-extension-is-proper-sql-or-pls-and-7393