Posts

Improving Query performance in SQL Server

Recently started learning more about performance related stuff in SQL server. Man oh man!!! so many things to learn and so many things to blog about.... Let us start with the basics: Writing a SQL query you need to measure a couple of things: 1. Query Cost 2. CPU Utilization 3. Time taken for the Query to execute 4. Table scans, Index scans and Index seeks. Let us start by focusing on Query cost---> Write the command- SET SHOWPLAN ON; and then execute a SQL for example--> SELECT E.EmployeeID,E.EmployeeStatus FROM Employee E where E.AddressID = 112345 ORDER BY E.EmployeeID This command will basically give us the Query analysis built into the SQL server. The first aspect you will notice is the Query cost... In this case if there are indexes on the underlying table then we can state that the query cost might be less provided the index is being used else the query cost is going to increase significantly. Also we can minimize query cost by inclusing more filters in our SQL query provi...

People's dilemmas and the repercussions that arise...

I just noticed that the face of humanity has changed a lot from my generation. People tend to not take responsibility very well and keep nagging about various things that actually dematerialize the very foundation on which humanity is built on. Act1: User forgets MP3 player @ office and asks one of his office colleagues to look after the MP3 player. Act2: Colleague decides to keep MP3 player in his/her drawer without locking it. Act3: MP3 player gets stolen. Act4: Colleague pretends to be cool about the MP3 player and coy about the fact it gets stolen. According to his/her logic, the MP3 player would have eventually been stolen because of User's forgetfulness. Is this what humanity is preaching now.... irresponsibility?? Pathetic display of human unresponsiveness to a general situation. Lets us take the current predicament facing us @ the national level. The Lokpal bill is supposed (???!!!) is supposed to eradicate or subside the rise in corruption by giving the common man more pow...

Dexter is pretty good....

Have not been followin a TV series in a while (The last two I followed pretty religiously were Castle along with Bones and these two were pretty good). But in the recent past I have been following Dexter and another called Spartacus (I was able to catch all the episodes of Blood & sands as well as Gods of the arena). Spartacus is pretty slick in its cinematography bcoz its more like watching bits and pieces of 300 (a good movie) with more of a storyline and the explicit no holds barred kinda program really takes you back to the past. But Dexter on the other hand is quite different from the rest as it shows a bad guy killing other bad guys for sport. I mean to a certain extent what he is doing is nothing but being a vigilante since he is helping in takin out the trash. But does he have the moral right to do so...hmmm (pondering over this). Dexter has a disease and a nasty one at that. He is trying to control it by focusing it on bad guys. But how does he justify whether the person i...

Cycle Adventure with IT......

OMG!!! I dont know who I am!!!! Seriously nowadays there are several dime a dozen clones of you online. Being serious here --> Identity theft (IT) has certainly become rampant in all parts of the globe. Maybe some slander your very means of existence & others might be to increase your popularity (online stalkers? ahem). I dont know where I am going with this article but I thought that maybe becoming a Jason Bourne after your identity has been stolen is easier than one thinks. Can this be done easily?? Yes but why?? Does your existence (i.e. the one stealing the identity) does not have a life of his/her own??? Social Networking sites are ever increasing but is that really you on that site?? Lets get past the garbage I wrote earlier and come to the adventure part. Rode a cycle to office today (and back home too --> believe it you naysayers). Maybe about 40 kms. Not bad but more than the back pain it is the back side pain that leaves you struggling. Scenario--> I am in a res...

SSIS tips and Tricks

Image
Finally a technical article after a reallllly long time............ Tip 1: Ensure that when you fetch data from an SQL server data source always use the "(NOLOCK)" option in the sql statement example: select studentid,name from student (NOLOCK) This ensures that a deadlock does not take place (best option to use in a multi user environment :) ). Tip 2: The maximum packet size that can be transferred across a network is approximately 4 MB. Here we could improve the performance of our data fetch from the source and data migration to destination by modifying the connection property of your SSIS package. Right click on the the connection and click properties, you will find a property called packet size: Make sure this packet size is about 32767 to get the maximum benefit across a network. Tip 3: When you have multiple tasks running in parallel in a package(The maximum an SSIS package can actually subdivide these tasks or SSIS can spawn a maximum of 8 processes), so it would make ...

Cartoons from the 80's

Just thinking a couple of days ago as to the cartoons that I used to watch as a kid (still watch some of them when I get the time). Cartoons are like a breath of fresh air at times. Man, I used to watch so many cartoons. Here is a list of some that I could remember (I can tell my kids someday that these were the cartoons I used to enjoy watching..... a lot of nostalgia here): 1] Grandizer 2] Thundercats 3] Inspector Gadget 4] He-Man and the masters of the Universe 5] Captain Majid (I used to watch the arabic cartoon version) 6] Swamp Thing 7] Skyhawks 8] G.I.Joe 9] Rambo 10] Mr. T 11] Transformers 12] Banana Man 13] Pink Panther 14] Looney Toons 15] Care Bears 16] Smurfs 17] Voltron 18] Ghostbusters 19] Police Academy 20] M.A.S.K 21] Duck Tales 22] Chip & Dale - Rescue Rangers 23] Dennis the Menace 24] The Racoons 25] Count Duckula 26] Transformers 27] Spideman and his amazing friends 28] Bravestarr 29] TMNT 30] Denver the last dinosaur 31] The Hulk Maybe I should keep posting list...

Be blatantly honest shouts CEO....

Recently read an article by the CEO of Google. Mr. Eric Schmidt tries to emphasize that business works primarily on the pillar of honesty and being brave enough to admit when one is @ fault. I do agree with Mr. Schmidt but there are certain aspects where taking responsibility will not achieve anything but a more severe reprimanding by the powers to be. Rather than accepting fault readily people especially at the top should first investigate as to what the impact of a particular transaction/event can do. Once this is done, what are the steps necessary in order to ensure that the details are and will be ready to the public @ a gradual pace. Nowadays due to the impact of media, information gathering as well as spreading will hardly take a couple of seconds. The media has the right to make their assumptions as well as the fact that it needs to be extremely clear to the public that @ the end of the day, it is an assumption and not a fact. People are always ready to jump to several conclusio...

Save the tiger.... ehem!

Image
Follow this diagram to save the tiger Note: Created this one after seeing the Aircell ad. Could'nt post it earlier. Follow this diagram and evrything will work. --> Simple and ideal. (i)We got to move inwards out so our primary goal is to secure the land for this magnificent animal. (ii) The second step is to have a steady food source for the tiger (which would include the food source for the tiger's food source and naturally the cycle will continue till everything is in place) (iii) We need to have uncorrupt officials in charge of taking up this magnanimous/huge responsibility and ensure that funds raised are directed towards the correct measures. This is the root cause of the tiger's problem. We fix this and we can save the tiger for sure!!! (iv)Taking a regular census of the tiger population (either the goverment does this on a regular basis or they could actually utilize the private census benefits offered by international wildlife protection agencies). (v)Kick poach...

SQL Concepts

Just to refresh my memory, I am going to jot down the following as part of my cheat sheet, so that one glanceover would refresh my memory: ACID :---> Atomicity: This is the process by which any transaction performed on a DBMS, will not take place (or will be rolled back) in case a part of the transaction fails. Consistency: Consistency implies that the state of the database would be constant at any period of time. During transactions, the db would move from one consistent phase to another consistent phase. (All the constraints and regulations of the database is maintained) Isolation: Isolation indicates that every transaction is performed as a seperate action and will not be interdependent on one another. In case of any such dependencies then the transactions will take place in a sequential manner (based on FCFS or some priority based operation) Durability: This indicates that the database will be robust and will not collapse at any period of time. At frequent time intervals snapsho...

Pharma Software Companies --> Plans I have for ya!!!

This initially was a set of plans I had given to an organization I used to work for, (These ideas were given about 2-3 years ago and still have merits at this time and age). I have a couple of ideas which I feel the any Pharmaceutical software company could really capitalize on. The ideas and suggestions I have are as follows: A] The Indian Pharmaceutical market is burgeoning in size as well as improved technological capabilities have ensured that the Indian field force is on par with most of its counterparts across the globe. I feel that it is extremely important to strike the iron when it is hot. And this is a golden opportunity to showcase our products (probably a more stripped down version of MI and the other products in our product suite) to the Indian market. The cost factoring will definitely be a major hassle but I am sure our great marketing minds in your organization would definitely come up with an idea to embattle this and get the price bracket right. I presumed that with ...

Microsoft .Net Framework

Image
Many people have their own interpretation of the Microsoft .Net framework. Here is my 2 cents on this. We first need to understand that the framework is a collection of assemblies (resource & binary files) that enable us to program. The framework generally consists of 3 main components:- 1] CLR (Common Language Runtime) 2] FCL (Framework Class Library) 3] ASP.net Runtime Now the CLR is a vast topic which would probably take me years to document but I feel that the MSDN website gives us a general understanding. Now if we take a look at the above diagram, you would sort of find yourselves asking one question: Why did I not add in the CTS and CLS as part of the Framework i.e. because the CLR is primarily responsible for the CTS and CLS and I would classify it in the following manner: 1] CLR --------------------> CTS ----------------------->2 --------------------> CLS ----------------------->2 2] FCL 3]ASP.net runtime Now a useful concept to understand here is how is our pr...

My entry into ET Prodigy

I would like to consider myself as some sort of a prodigy (ahem!!! cough persisting for some time). This is my entry into the ET prodigy contest that took place last month. I must say I could have presented my understanding better but I had to follow the competition guidelines to the "T". Here it is: Sustain World (SW) provides services towards existing small scale ventures that have a foothold in the market place or to educate individuals or institutes and channeling their energy into setting up their businesses. The maximum acceptable annual income of its target audience would be 45,000 Indian Rupees(INR). The variable costs for Sustain world to come into existence would be somewhere between 4 lakh INR. Now there is an extremely high probability that most of the small scale ventures undertaken by individuals in the case of SW will never evolve from the proof of concept stage or might die in the nascent stages of creation. SW more or less will have a well sustained and aggr...

Is Google making us stupid????

Man oh man, I wish the answer to this question would be in the negative but this is reality. How many of us so called techies do not use google in our day to day lives. I am sure the engineers at google themselves pride over the fact that they use their monster creation for day to day activities. After Google has come into our midst, it has left us in shambles. For example, even when I come across a simple error, I lookup google without even blinking an eye or giving my mind a whack at the error in front of me. The application of our minds is limited to thinking only when we do not have a computer stuffed in front of our faces. Google creators Larry Page and Sergey Brin thought they are helping mankind with this creation of theirs. But eventually this has turned out to become a Frankenstein like monster. It is making at least 75-80% of the americans stupid and not only americans are in this fray, we Indians are not so far behind. I would say we would be more or less in the 45-50% cate...

Strategy Pattern

Image
Well it has been a long time since I wrote something and I thought this time it would be cool that I wrote something technical. Before that I just wanted to mention that I completed my MCTS (Microsoft Certified Technology Specialist) with scores of an 89 in framework and a 95 in web. Not too bad I must say as I took about 3 days each to prepare for both these exams. Just going to add my MCTS logo with this post right about here --> Anyways have been keeping myself busy learning design patterns. Patterns are really cool especially if you are the sort of person who likes to design (Well I am more of the sort of person who would give the idea for the design rather than implement it). There are way too many patterns out there to be mastered but I rely on probably 4 to 5 of which I will talk about one below: 1] Strategy Pattern: Now this pattern is probably the easiest to master. It involves taking a preexisting set of classes and exposing their properties to other newer classes using i...

David vs Goliath

This is an article I wrote a long time ago. It resurfaced when I was searching my hard disk for something. Well here it is: Many people believe that great things are possible to accomplish only if it is written in their destiny. These people are the one’s who give pessimism a bad name. Being pessimistic at times is good but too much of it is also a detrimental factor bringing one’s world as you know it to a complete stop. But this is not what this article is about. This article is about the small companies against the big companies. Many people have expressed their views on this topic before, but I would like to give a whole new dimension to this. Bill Gates did not start a multi billion dollar corporation by twirling his fingers in a magical fashion. It was hard work and dedication all the way. He also had this innate ability to read a person’s mind which is the primary quality of any successful businessman. After bringing Microsoft to the top of the IT industry, he is trying to keep ...

The year that passed me by

Well 2008 did not turn out to be the roller coaster ride I expected it to be. Here is the list of stuff that happened this year: 1. First and foremost, I royally jacked my GMAT exam (Of course I will be taking it up again but I should have gone in with more prep rather than confidence). 2. I seem to be making a meager living working in my current company. I should have taken up the job offers I was given by other companies (screwed this one up!!!) 3. I am shaping out to be a fat blob. I have not been exercising regularly and have become a bit lazier than usual. 4. The recession has not done me any good. The catastrophic problems that have literally brought the U.S economy to a brink of rapid disintegration has in deed made a gaping dent in my pocket. 5. CAT was a cinch, I should have improved my math speed and I might have just made it into an IIM. I definitely believe that I haven't crossed the cut off in Math. Any takers on this one??? 6. Family life for me is getting complicated...

Socialization of a muddled personality

In the recent past, my socialization skills has been wanting. Its not that I am an introvert who claims to be an extrovert nor am I the vice versa. The fact of the matter is that I perceive myself to be someone who is inbetween these two extremes. Bu why is it that I have defined boundaries? Why is it a human tendency to restrict oneself with a barricade developed more in terms of a mental capacity than one in the physical realm? If I had the answers to these I would most definitely not be asking them now. Does society have space for genuine misfits like me who try to focus on self made rules and tend to be critical towards those made by others? That's a question time will certainly tell. Check out this must watch video: "Good morning, good evening and good night!! my fellow netizens of the world!".

Ajaxify ASP.NET 2.0 apps with AJAX 1.0

Recently started using the AJAX 1.0 framework for building web apps with ASP.NET 2.0. Amazingly simple and easy to use. The AJAX framework consists of very few controls. The most important of which is the Script Manager, Update Panel and Update Progress controls. Now after installing the framework, all I had to do was place the Script Manager control on the webform. The script manager is the control which registers the client side scripts for ajaxifying the web app i.e. instantiates the XMLHTTP activex object and collectively gathers response when the ready state is successfull(4). It also performs the partial page rendering on the respective page. After placing the script manager on the web page, drag and drop the update panel control onto your web page. Any server controls that require asynchronous postbacks to occur, must be placed within the update panel. Also ensure that the page attribute EnableEventValidation property is set to false.Walaah, your webpage with Ajax is done. The f...

Service Oriented Architecture

With modern day technologies getting outdated the minute they see the light, service oriented architecture is the key to the future. Why services you ask me?? Plug and Play is the answer and it is as simple as that. I realized the necessity of utilizing service oriented architecture in our day to day lives. With the expansion and increasing utilization of the internet, web based technologies are growing at a rapid rate. Certain amazing stuff have come out of the stables of Google (an awesome company), Yahoo (not too far away), Microsoft (things seem to be getting only better at the Redmond center) etc. I just came up with an Idea for a purely service oriented software which can be used across domains but for sales and marketing. I will start writing a whitepaper on this pretty soon. And just started brushing up on my math basics (good ol' MBA prep). I probably will write my GMAT in May 2008 and might even give CAT a shot. I will join a course in Jan 2008 for CAT. Keeping my fingers...

Game Plan

I have decided once and for all, an MBA is for me. I am going to give it serious prep and push myself to all extreme levels to attain an MBA from any of the top ten B schools in India or atleast the top 20 in the U.S. The colleges I have shortlisted are in the following order: Kellog school of business management MIT Sloan college UCB Haas College ISB Hyderabad S.P Jain --> Dubai, Singapore and Bombay Did I forget to mention the IIM's, Jamnalal Bajaj, Harvard, Wharton e.t.c. Most of you might say that "oh! what a kidder I am?" but I aint kidding anymore. I am just a wastrel. I was kidding myself all the time that I could make it to the top without lifting a finger. But not anymore, tomorrow I begin a new leash of my life and ensure that patience (I truly lack) kicks in and eventually accomplish all my goals. What my goals are???? you ask. If I tell you I would have to kill you. On a serious note and an ode to the Rocky series, "I am a fighter and that's a...