Posts

Showing posts from 2012

Override Methods in C#

In C#, when we override methods we have to keep remember some important points. Assume there is a parent class called ClassA and it has a method called method().  If we are going to override that method in  a subclass ClassB, we have to use virtual and override keywords properly in suitable places. virtual should be used with method() in parent class and  override should be used with method() in sub class. If we do not use these keywords properly Overridden functionality  is not working properly.  namespace BasicLangEx {     class ClassA     {         public virtual void method()         {             Console.WriteLine("Method A");         }     } } namespace BasicLangEx {     class ClassB : ClassA     { ...

Tips to Tune SQL Queries

In this post I hope to give some knowledge about the Oracle Execution plan and  the some tips to optimize sql queries for better performances. Execution Plan Oracle can run Explain plan for given SELECT, INSERT,UPDATE, DELETE SQL  statements as below Oracle - EXPLAIN PLAN FOR SELECT customer_name FROM CUSTOMER; MySql -   Explain SELECT customer_name FROM CUSTOMER;   Then it displays the execution plan chosen by the Oracle optimizer, which contains the  sequence of operations used to run a particular sql statement. Execution plan contains,  tables, views referenced by the statement access methods for each tables and views (table access full,table access by index) join methods data operations such as sort, aggregate cost, cardinality parallel executions   According to the execution plan you can get the idea to optimize a given sql statement in  a proper way.Now I am going to explain the ways that can be used to tune/optimize the...