Get the App
SLTechnology News&Howtos  ›  Database  › 

Some code optimizations in the work

Shulou Source: shulou.com Published: 2022-06-01 10:04:22 11月15日 Update

(1)Avoid unnecessary nesting of loops in your code, and if there are nested loops in your code, see if you can refactor your code without

(2)Select into creates tables, resulting in DDL transactions, so DDL operations are best handled as separate transactions (for Oracle).

(3)Avoid executing Sql cyclically, accessing the database continuously consumes the most performance

(4)In sql statements, try to use union all instead of distinct, you can load the data first and then process duplicate data

(5)Try to use table variables instead of in, and temporary tables

(5)SQL statement, try not to use, will lead to full table scan

Tags: Code data loops transactions statements processing maximum continuous creation variables performance database time best consumption independence refactoring place work Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Huawei Shulou Information Linux Apple NVidia