Nov 30

Continuous Integration is a software engineering process to speed-up the delivery and reduces the integration times. Basic mantras of continuous Integration are “Test Early” and improve the quality.

Continuous Integration means that we capture entire process, every step that turns our source code into software:

  • Build our code on every commit, on a schedule or on demand, with sophisticated build management.
  • Deploy the code to any enviornment, including development, test and staging with deployment scripts or automation.
  • Test daily build by automating the unit test cases.
  • Release with confidence along with the visibility and control.

         
     

CIM Best Practices

  1. Maintain a single source repository.
  2. Automate the build.
  3. Make the build self testing.
  4. Commit every day.
  5. Every commit builds on an integration machine.
  6. Keep the build fast
  7. Test in a clone of the production environment.
  8. Make it easy to get the last executable.
  9. Everyone can see what is happening.
  10. Automate deployment.

It is a process of clean rebuilding of project code base to ensure that new changes integrate well into the existing code base and provides feedback on the quality of new changes, so that fixes can be delivered in a timely manner. If the changes do not integrate and break the project code base, we can revert codebase back to stable release. Continuous integration avoids or detects compatibility problems early. If we integrate throughout the project in small amounts, we will not find ourself trying to integrate the system for weeks at the project end.

Advantages & Overhead

  1. Early warning of broken build.
  2. Automatic unit testing of new changes.
  3. When unit test fails, developers can revert the codebace back to stable state.
  4. Constant availability of “Currrent” build.
  5. Frequent code check-in pushes developers to create modular, less complex code.
  6. Quality improvement: Developers get feedback about quality, functioanlity, and impact of code they are writing.
  7. Intgration problems are detected early.

Overhead of adopting this process is to setup and manage continuos integration software on a dedicated server.

Software Available for CIM:

  1. Cruise Control for Java & .NET
  2. Hudson
  3. Apache Continuum
  4. Microsoft Team Foundation Server

A successful integration is a measure of progress. It provides feedback that new code runs correctly in the integration envrionment and successfully interoperates with rest of the code base.

In TarKia, we use Hudson open source software to implement continuos integration. We are using Hudson to promote our code from SVN to test, beta and production environments.

Screenshot of Hudson control panel

Tagged with:
Nov 29

Tips & Tricks for optimizing SQL queries.      

Many developers assume that their goal is only to write SQL statements that deliver the correct data from Oracle. But it’s not enough. In reality, formulating the SQL is only half of their job. Successful Oracle shops always require that developers ensure that their SQL accesses the database in an optimal fashion.

In my opinion optimizing SQL query is not belong to such topics, which can be completed in one discussion. So, in this article I will discuss Indexes with you.

Indexing is very basic concept in terms of query optimization.Indexes can decrease the execution time of a SQL SELECT query dramatically. Indexes are functionally, less fundamental than tables. Indexes are really just a means to reach table rows quickly. They are essential to performance, but not functionally necessary. Ideally, we should use indexes if our select query is fetching 0-5% of total number rows.

 Types of Indexes

 B-Tree Indexes

The most common and most important type of index, by far, is the B-tree index, which reflects a tree structure that is balanced (hence the B) to a constant depth from the root to the leaf blocks along every branch. B-Tree indexes are the regular type that OLTP systems make much use of. Fig below shows a three-deep B-tree, likely reflecting an index pointing to 90,000-27,000,000 rows in a table, the typical size range for three-deep B-trees.                 

A three-level B-Tree index 

B_Tree

Bit-Mapped Indexes

Bitmap indexing provides both substantial performance improvements and space savings over usual (B*-tree) indexes when there are few distinct values in the indexed columns. Bitmap indexes are a highly compressed index type that tends to be used primarily for data warehouses.

 Statements not written for Indexes.

 Some SELECT statement WHERE clauses do not use indexes at all. Most such problems are caused by having a function on an indexed column. Here I am listing those functions which should not be used on indexed columns in WHERE clause of SELECT statement, because they nullify the effect of indexing. These are

1)      Avoid NOT operator

i)                    SELECT student_num,student_name

FROM student

WHERE student_num NOT LIKE ‘9%’;

ii)                  SELECT account_name,  trans_date, amount

FROM transaction

WHERE amount != 0;

2)      Avoid SUBSTR function

SELECT account_name, trans_date, amount

FROM transaction

WHERE SUBSTR(account_name,1,7)=’CAPITAL’;

3)      Avoid concatenate function

SELECT account_name, trans_date, amount

FROM transaction

WHERE account_name||account_type=’AMEXA’;

4)      Avoid Arithmetic operators(+,-,*,/) 

SELECT account_name, trans_date, amount

FROM transaction

WHERE amount+3000<5000;

5)      Avoid indexed columns on both sides of an operator

SELECT account_name, trans_date, amount

FROM transaction

WHERE account_name=NVL(:acc_name,account_name);

6)      Avoid TRUNC function on indexed columns

SELECT account_name, trans_date, amount

FROM transaction

WHERE TRUNC(trans_date)=TRUNC(SYSDATE);

 We have two alternatives to come out of such situations

i)                    Try some other alternatives for these Select statements

ii)                  Set QUERY_REWRITE_ENABLED to TRUE and OPTIMIZATION_MODE to CHOOSE in init.ora file. Then create function index instead of simple indexes. Now above select queries will work fine.

 7)      Use same data types in both sides

Select emp_no, emp_name,salary

From emp

Where emp_type=123

*Data type of emp_type is of VARCHAR2 type.

 So if we want to write optimized SQL queries, then we should take care of above mentioned functions, operators on indexed columns.

Nov 29

If you haven’t experienced the frights of Vista firsthand, you’ve no doubt heard about them: how it takes forever to power up and shut down, how the software constantly nags you, how it hogs precious PC resources and how it’s incompatible with all-too-many third-party peripherals and programs.

Following are some of the comparisons listed for an insight into the Windows 7 features over Vista

Integration of peripherals

Windows 7 has got very good support for any of the peripheral devices attached to the computer. You will not run into any sort of issues with Drivers of the plug and play device as Windows 7 has been included an ocean of such drivers, and if by chance the driver is not existent there, Windows 7 will find it over the net for you. Windows 7 has turned it peripheral detection and support more into devices central rather than shooting an auto run option as it used to be with Vista. E.g. suppose say you plug in a camera, Windows 7 might take you to that manufacturer’s website, where you might be having an option of uploading your photos to an online album. With a few exceptions, compatibility hasn’t been a major issue.

Improvements in UAC

Windows 7 does not shows up overprotective dialogue boxes as soon as you make some changes in the settings of the system as it happens in case of Vista even when you installed a small software or change the speed of the cursor. That does not mean that security has been sacrificed, Windows 7 still maintains quality protection against malicious attacks. Windows 7 will only display messages when major settings are changed.

Introduction of the Brand new Taskbar

Windows 7 has gotten rid of all those useless balloons popping every now and then and that keep annoying the user. Microsoft has made sure that in Windows 7, you have the complete authority to change the settings required and allow or disallow only the required icons and also change the settings for notifications that might appear on screen and distract you. It has Jump Lists feature which will allow you to access common programs very easily. And you can see the full screen preview before switching to a window.

taskbar

Performance

Microsoft has lived up to its promise to deliver the operating system that is much faster that Vista. Windows 7 has very few startup processes and there are very few processes in the background that keeps running and eat up the memory cycles. Windows 7 also better utilizes your RAM and seems to be able to run better on lower spec. machines than Vista ever could.

Windows XP Mode

One of the best features of Windows 7 is the new Windows XP Mode that lets you run older Windows XP business software right on your Windows 7 desktop and that is much needed as there are lots compatibility issues when we run some software on Vista machine.

Designed primarily with small- and medium-sized businesses in mind, Windows XP Mode comes as a separate download and works only with Windows 7 Professional, Ultimate, and Enterprise. Windows XP Mode also requires virtualization software such as Windows Virtual PC. Both are available free on the Microsoft website.

Multi-touch Feature

Touch technology has become the latest trend after Apple’s revolutionary multi-touch iPhone, Last but not the least, Windows 7 has multi-touch for all the supported hardware and that was not included in Vista.

For conclusion I would say that the latest incarnation of Windows does show significant improvements over its previous version of OS in terms of performance, startup, UAC, Brand new taskbar etc. Windows 7 can only be better, and it should finally give long-standing XP fans a reason to upgrade.

Tagged with:
preload preload preload