Tuesday, August 11, 2020
dbametrix
More
    Home Sql Tutorial You should maintain your sql statement identical

    You should maintain your sql statement identical

    I am starting this new section called SQL tutorial. This section doesn’t contain only basic SQL statement written learning but it also contains some guidance and advice from my experience. SQL is called as sequel sometimes. Don’t bother!

    Always use SQL writing pattern identical. It means you need to use your writing style pattern unique or same type repeatedly.

    - Advertisement -
    dbametrix

    Take an example:

    select * from emp;

    SELECT * from emp;

    - Advertisement -
    dbametrix

    select * from EMP;

    select * FROM emp;

    SELECT * FROM EMP;

    SELECT * from EMP;

    SELECT * FROM emp;

    Select * from Emp;

    All are the same kind of statements. Looking wise all are the same. The result of the above all statement is also the same but the System Global Area of Oracle memory treats all statements are different. Thus, above all statements will be parsed separately and occupy memory separately.  The problem starts with those SQL statements which are written in a different manner.

    This is the only example. In real-time if you check your long SQL statements and guess how it will be stored in the Oracle SGA memory region? Those long and big SQL statements will consume so much memory in the Oracle SQL engine. Resulting memory is wastage and unnecessary parsing. Hard parsing always consumes high CPU and SQL statements will consume memory. It means so many performance issues can be occurring due to this bad practice.

    I have seen lots of developers and programmer who has its own pattern of SQL statement writing. But when you are changing the company and joining the new company then you should need to observe this thing first for keeping your mind that which writing pattern is being followed by your company’s old employee. Or as the project manager, IT manager you need to develop your own skill and fix the pattern of the Structured Query Language writing method. An example you can keep all table names in uppercase and the rest of all in lower cases. You can keep all in lower case.

    Therefore, avoid this kind of silly mistake before you are starting to write a new SQL statement in your company.

    0
    - Advertisement -
    dbametrix
    - Advertisment -
    dbametrix

    Most Popular

    ASM Disk creation issue

    The article explains how to troubleshoot Oracle ASM disk creation. Solution of Oracle ASM disk creation with ASMLIB

    Oracle Tuning Basics Part-2

    This is the 2nd part of Oracle database tuning basics including depth of every aspects.

    Oracle Tuning Basics Part-1

    The article explains Oracle database performance tuning basics details.

    When you finding new job

    The article guides you 10 things to remember when you are searching a new job to improve yourself including skills and better growth for every DBA.

    Recent Comments