SQL Index Manager – a long story about SQL Server, grave digging and index maintenance

в 5:14, , рубрики: .net, azure, columnstore index, devart, index maintenance, index rebuild, Microsoft SQL Server, ola hallengren, redgate, sql, sql index manager, sql server, statistics maintenance, Администрирование баз данных, Программирование

SQL Index Manager

Every now and then we create our own problems with our own hands… with our vision of the world… with our inaction… with our laziness… and with our fears. As a result, it seems to become very convenient to swim in the public flow of sewage patterns… because it is warm and fun, and the rest does not matter – we can smell round. But after a fail comes the realization of the simple truth – instead of generating an endless stream of causes, self-pity and self-justification, it is enough just to do what you consider the most important for yourself. This will be the starting point for your new reality.

For me, the written below is just such a starting point. The way is expected to be lingering…

All people are socially dependent and subconsciously we all want to be the part of society, seeking to get approval for our actions from outside. But along with approval, we will be constantly surrounded by public assessment, which is supported by internal complexes and constant restraints.

Often we are afraid of failure by constantly postponing things that are important for ourselves and then logically rationalizing in our head trying to reassure ourselves: “it didn’t work out anyway,” “it won’t be approved by others” and “what is the use of doing it?”. Many of us simply do not know how strong they are, because they have never tried to change something in their lives.

After all, if a person does only what he can — he automatically creates a template in his head: “I can do it… I will do it...”. But there is nothing outstanding in the fact that a person does only what he can. He did this because he could, but at the same time remained in the same range of his original capabilities, in which he had been all this time. But if you were unable to do something but you managed to – that is where you are fucking good. After all, only when we leave the comfort zone and work beyond our range of capabilities we can develop and self-improve.

My first attempt to make at least something significant began in the fourth year at the university. I had already had some basic knowledge of C++, and one unsuccessful attempt to memorize all the books of Richter on the strong advice of a potential employer. Accidentally, I came across the OpenCV library and a couple of image recognition demos. Unexpectedly, I started to spend sleepless nights in my attempts to figure out how to improve the functionality of this library. Many things did not work out and by reverse engineering I tried to look at products of a similar orientation. It got to the point that I learned to disassemble one commercial library and gradually got some algorithms that I could not implement by myself.

The end of the fifth year was approaching and I started to enjoy more and more everything I had been doing all this time. As it was already necessary to start working to the full, I decided to write to the developers of the commercial library from which I scooped up my ideas. It seemed to me that they would easily have hired me, but after a couple of letters about my desire to work with them, our conversation did not lead to anything. There was a slight disappointment, and strong motivation to prove that I can achieve something by myself.

Within a month, I built a website, uploaded everything on a free hosting, prepared documentation and started selling. There was no money for advertising, and in order to somehow attract the attention of potential customers I began to distribute my crafts under the guise of open-source. The rebound was about 70%, but, unexpectedly for myself, the remaining people, albeit reluctantly, but began to buy. Nobody was embarrassed by my poor English, or by the free hosting on which the site was stored. People were satisfied with the combination of low prices and basic functionality that met their needs.

There were several regular customers who wanted to invest in my venture as partners. And then the developers of the library itself, from which I learned a lot once, appeared out of the blue, gently throwing a hint that their algorithms are patented and you’d better not quarrel with them, brazenly taking away their clientele. Our conversation was far from being polite, and at a certain stage I decided to offer them to kiss my ass. The next day, they sent an official letter that they were ready to cooperate with me, but I abruptly broke off the dialogue with them. In order to be safe from the future attacks from these guys, I started preparing patent documentation and applying for copyrights.

As time slipped by, this story gradually began to be forgotten. The plans were to hire a more experienced person to help me, but it was too costly. Greed took over and it was obvious that I wanted to grab a big jackpot. A meeting was planned with a new client who, as it turned out in the process of our communication, was located in the same city as me. Voluptuously describing the prospects of cooperation, he offered to meet in person.

Eventually, several young people of a “pleasant appearance” came to the meeting and, without even asking my opinion, offered to take me for a ride outside the city, insisting that it was an urgent need to «get some fresh air.» Upon arrival, a shovel with “Sergey” carved on it was issued to test the skills I had learned in my childhood at my grandmother's potato plantations. And over the course of an hour, my perspectives were roughly explained to me. They suggested not dissipating my strength, and offered to stop doing nonsense, and most importantly, to stop being rude to serious people.

At one moment, the world ceased to seem a sunny and pleasant place. It’s hard to say if I acted correctly then… but I gave up… abandoned hope and hid in a corner. And everything mentioned above largely determined what happened next: latent anger towards others because of lack of implementation, uncertainty for many years, apathy in making important decisions for themselves and shifting responsibility for their fuckups to someone else.

At that time I was running out of money and it was necessary to urgently put myself in order, but everything literally fell out of my hands. Thankfully, my father helped me a lot. He found a place with the help of his acquaintances where I could have been hired without asking any questions. Later, I found out that for my sake he owed a lot to quite unpleasant people – a sacrifice for giving me a chance to show myself.

Preparing for a new job, I got back to the drawing board began to read Richter and intensively studied Schildt books. I planned that I would be engaged in the development of .NET platform, but in the first month of my official work activity things ordered a little bit differently. One of the company's employees unexpectedly left the project, and fresh human flesh was thrown into the newly formed hole.

While a colleague was collecting things, I had an epic dialogue with my CFO:

— Do you experience in SQL Server?
— No.
— Learn overnight. Tomorrow, I will try to slip you to the client as a Middle SQL Dev.

This is exactly how my acquaintance with SQL Server began. Everything seemed new, incomprehensible, and frequently done by trial and error. There was a lack of a number of intelligent mentors, to whom I could feel equal.

The following few months everything looked doomy and gloomy. The projects were interesting, albeit they were let slide by the directors. Rush job began, eternal overtime and tasks that no one could often even formulate normally unfolded just before my eyes. I found pleasure in the eternal refinement of the report on the unfolding of ready-made cakes to simple half-stuff. But since any cake could be a part of another cake, I was flipping out from this harsh business logic.

I realized that things would only get worse and decided to get into action. I freshened up the theory and decided to try my luck in other places, but I didn’t have enough experience at the interviews to lay claim to being at least a strong junior. The first couple of days I impressed by my own fails, and I seriously thought that it was still very early to change a job and I had to gain some experience.

Eventually, I began to cram SQL Server and completely plunged into database development. I will not deny that this work was a living hell for me, where the practicing schizophrenic in the person of the CTO cheered me up literally every day, being accompanied by the CFO – a former military from Afghanistan, who, in the outburst of emotions, used to munch on heads of rubber ducks during lunch time.

At one point, I realized that I was ready. I collected all the crucial work, ensured a high frequency of releases and directly normalized relations with clients. As I result, I managed to come and make the CFO bend over. Now it could be possible to joke about 23-year-old seniors, but this is how I managed to raise my salary by four times.

The following month I spent being immensely proud of my achievements, but at what price? The beginning of the working day is at 7.30 am and lasted until 10 pm. My health started deteriorating, followed by the systematic hints from the directors that we’d better deliberately fuck up the project than let you earn more than it should be. To some extent they kept their word, and I was faced with the dilemma of finding a new job.

After a while I was invited to come for an interview at a product company. I was planning to leave for a similar position on .NET, but, to my horror, failed a practical task. At first sight they were glad to see the back of mine, but the most interesting thing happened just after my potential employers found out that I have some experience with SQL Server. I didn’t write much about it in the summary because I had never thought that I know a lot from this area. However, those who interviewed me had another opinion.

I was offered to improve the existing product line for working with SQL Server. Prior to that, they did not have a separate specialist who would be engaged in such activity, and everything was often done, as a rule of a thumb, by trial and error. New functionality is often simply copied from competitors, even without paying attention to details. My task was to show that you can go the other way, working through requests to system views more qualitatively than competitors.

Those several months have become for me an invaluable new experience in comparison with the previous activity in dealing with cakes. But as you know, all good things end sooner or later, and the directors suddenly changed their priorities. At that time, what done was done and I could find a better solution than to retrain as QA, which was a little at odds with our agreements on the development of new products. I was quickly offered an alternative — “to wait a bit”, and try to work with social activity and at the same time voluntarily agree to leave the development for manual testing.

The work turned into a monotonous series of regressions that did not motivate any further development. And in order to formally shirk regressions, I began to write technical articles on this website and then on other resources. It wasn't very good at first, but the main thing is that I started to be into it.

After a while I was entrusted to download the rating of the official company profile on Stack Overflow. Every day I came across interesting cases, tried to figure out tons of Indian code, helped people, and most importantly — studied and gained experience. This is exactly how I got a gold badge for SQL Server, which was a stunning period of my life.

By chance, I got on my first SQL Saturday, which took place in Kharkiv. My colleague had to tell the audience about the development of databases using products that we had been doing all this time. I do not remember why, but at the last moment I had to make a presentation. Denis Reznik, with a traditional benevolent smile on his face, transmits a microphone, and you try to tell people something colorific with a stumbling voice. At first it was scary, but then I got carried away.

After the event, Denis approached and invited me to speak at a smaller event, which traditionally took place in Kharkiv University of Radioelectronics. Time passed, the names of the conferences changed, the audience to whom I conducted the meet-ups grew slightly. Then I did not know what I am bound to do, but a series of serendipities formed my life choices and everything I decided to devote myself to in the future.

Trying to be equal to specialists like Denis Reznik, Dmitri Korotkevich, Dmitri Pilugin and other tough guys with whom I was lucky to meet, I understood that in the framework of the current work I would not have tasks for quick progress. I was able to observe good theory in the background, but it lacked practice.

I was offered to start a new project from scratch in a new place. The work from the first day was in full swing. All that I wanted to get from life I did have: an interesting project, a high salary and the ability to influence the quality of the product. But at a certain point, I relaxed and made a very serious mistake, right after we finished doing the MVP for the client.

Trying to concentrate on the development side and provide a better solution, I was less and less able to devote time to management and communication with the client. I was given help in the face of a new person who started doing this instead of me. Then it was difficult for me to understand the causal relationship, but after that our communication with the client began to deteriorate rapidly, overtime and tension in the team virtually skyrocketed.

Personally, I made an attempt to even out the situation on the project, restore order and return to a more relaxed development, but they did not let me do this. Everyone looked satisfied with the so-called constant fires that had to be put out.

After having analyzed the situation, I decided that I wanted to take a break from this tohubohu and suggested the CEO from the previous place of work to return to him on the terms that we will do a new project together. We discussed all the nuances and planned to start the development in a month. A month passed… then another… and another. All my questions had the same answer – just wait. The idea to make something of my own did not leave me, but I still had to temporarily take up freelancing and help the peoples of Central Asia to conquer the banking sector of Ukraine.

Just a month later, I found out that the development of my project was started at ease by strangers with the official permission from the former directors. These guys were cool .NET developers, but had no expertise in what they had to do. From the outside, everything looked like they were cheating me out of a project. In fact, it was so. In the outburst of indignation, I began to do this project on my own, however the motivation quickly faded away.

The former CTO offered to help him on current projects, and I began to do what I could do best — to put out fires. Having branched into workaholism, I reaped its consequences: an unhealthy diet, a far cry from normal understanding of sleep patterns and constant stress. This was all explained by two projects, which I alternately dragged towards a bright future. One of them, which had to do with horse betting, brought joy to work around the clock, and the second one was just a perverse understanding of management, so the team worked in the eternal rush job. This period in my life can be called nothing but masochism, but there were some funny moments, anyway.

In a completely relaxed mode, you’re digging potatoes at your dacha for your parents to the rhythm of retrowave and then you get an unexpected call: “Sergey… the horses have stopped running...”. After a couple of seconds of thinking, standing with a shovel and simultaneously training in yourself the skills of clairvoyant Vanga, you dictate the DBCC commands from memory so that a person can fix the problem on the server. I don’t regret having such an experience — it was awesome!

But here the most interesting begins…

One meeting at the end of September 2017 radically changed my life.

At that time, in order to somehow cheer myself up from the working routine, I planned to speak at the conference. During lunch, I accidentally had a small talk with a colleague in the kitchen. Out of a sudden, he told me: “It turns out that you are a well-known person… various people know you throughout the country”. At first, I didn’t figure out what was going on, but he showed me a chat on Telegram. I immediately recognized the girl who came to see me when I went to Dnipro with reports. I was very pleased that the person remembers me. Of the cuff, I decided to text her and invite her to Kharkiv to the conference, in terms of which I was preparing reports.

I gave the speech one of the first, and immediately saw her in the second row. The fact that she came was an unexpected and a pleasant event for me. We exchanged a couple of phrases and I started my long marathon of six-hour сhatter. That day was one of the brightest in my life: a full hall, 5 reports in a row and an indescribable feeling when people are into listening to you. It was hard for me to focus attention on the whole audience and my sight instinctively fell towards her… to that girl who came from another city… which I had known for two years, but we had never communicated with her… we just knew about each other all this time.

After the end of the conference, I was exhausted and quite depressed, but still I wanted to make the girl content by inviting her to have dinner together in the company of people with whom we both were. Frankly speaking, I was a terrible interlocutor, constantly cringing and demanding attention. It is difficult to say what happened to me then. Our stroll around the city at night did not work out as well. It seemed to me that the best thing is to take the girl to the hotel and go home to sleep. I spent the next day in bed, too weak to get up, and only in the evening I began to scroll down the words in my head that she said: “I came here just for you...”. I sincerely wanted to see her again, but by that time she had already left.

We talked for a couple of weeks, until I decided to go to her…

Just before the release, no one wants any shit for a client, I postponed the deploy and went to Dnipro. It is baffling to say what was going on in my head, but I wanted to see her, even without knowing what I would talk about. We agreed to meet in the park, but I epically confused the address and 5 kilometers went the wrong way. After a while, realizing my mistake, I quickly returned to the taxi with flowers I found in some chav area. And all this time she was waiting for me with a cocoa.

We had a seat on an unfinished theatrical stage, drank cold cocoa and talked about everything that came to our minds. Switching topics, she told me about her difficult past, about the inmutability of string data types on .NET… I caught every word of it. She was insightful and clever, sometimes funny, a little naive, but everything she said was sincere. Even then I realized that I fell in love with her.

Having returned to work, I was in an emergency mode trying to get a couple of days of vacation and go to her for a second time to make a love confession. In fact, everything turned out differently…

My childishness, stupidity, old complexes and unwillingness to believe a person to the full led to the fact that I greatly offended the girl who sincerely tried to please me. In the morning I realized what I had done and, as soon as possible, I went to ask for forgiveness from her in person. But she did not want to see me. Returning back, I tried to convince myself that I did not need her, but was it really so?

I was furious with myself for a month… I was like a bear with a sore head… I uttered such things to a person whom I sincerely liked, which it is impossible to forgive. It made me feel even worse in the heart and finally it all ended with a nervous breakdown and severe depression.

A former colleague, Dmitry Skrypka, who unveiled the gym for me, helped me find a way out of the vicious circle of self-castigation and internal complexes.

After that, my life changed a lot. I fully understand what it means to be weak and insecure. But when I started to train, I felt the best that the gym can give. This is the same sense of self-confidence and self-reliance. The feeling of how other people's attitude towards you is changing. And at that moment I realized that I did not want to return to the old life that I had. I decided to devote myself to everything that I was trying to postpone all my life.

Have you ever noticed that when a person starts something new, he begins to declare his intentions to the surrounding reality? Everyone constantly speaks eagerly about his plans, but time goes by and virtually nothing happens. Such people constantly say it using future tenses: “I will do it”, “I will achieve”, “I will change” and so they live their wishlist from year to year. They are like a finger-size battery — the motivational charge is just enough for one flash and then everything. I was the same person…

Initially, I planned that in the company of motivated colleagues, you can knock the world flat, but often the expectations of the bright future differ from practice. Starting to do our own project, we constantly planned and discussed instead of buckle down and do it.

Often, everyone wants to do it quickly… everyone wants it on the first attempt… all of them are sprinters… everyone starts to run, but time passes… one surrenders… the second one surrenders as well. When the finish line isn’t looming on the horizon, few people want to work hard simply because they have to go the distance to the end… in the morning, afternoon or late night… when no one sees, no one will praise and no one will appreciate what you are doing.

Never share your plans until you implement them. Share only the results no matter how hard it was to do it on your own. Undoubtedly, in this case, the path we have chosen will not always bring pleasure and pink unicorns with rainbows shining from their asses. We will not always be driven by bright motives in the work on our priorities. Now and then life will constantly send you to the place you would never like to go. But every time I opened Visual Studio or when I came to the gym I remembered I was and how I can be. I recalled a meeting with that girl from Dnipro, which made me think about my attitude to life… I understood a lot.

Usually, the final word should be capacious enough to bump into the memory for a long time. I want to quote the words that I once heard in the gym from one intelligent person.

Do you think you come to the gym to fight with the gear… with the dumbbells? No… you are fighting with yourself… with your templates… with your laziness… with your frames into which you drove yourself. Do you want to constantly solve other people's problems by postponing your own? Let it be by means of smaller steps, but you need to confidently go to where find your happiness in your entire life, simply because happiness is the condition when the principles and rules, that you did not invent, are not your burden. Happiness is when you have a vector of development, it means enjoying yourself in the process, not from the final goal. So maybe it is worth getting your ass up and starting to work on yourself?

Oh yeah, I completely forgot… initially this article was conceived in order to acquaint people with the project that I was doing all this time. But it turned out that in the process of writing, the priority shifted to the description of the reason why I started doing this activity in general and why I don’t want to leave it in the future. Briefly about the project…

SQL Index Manager – is a free and a more functional alternative to commercial products from Devart and RedGate and is designed for index maintenance on SQL Server and Azure. I cannot say that my application is better than the scripts from Ola Hallengren, but due to being more optimized and offering various useful features for someone, this product will definitely be handy in everyday tasks.

SQL Index Manager

SQL Index Manager

The latest version of the application can be downloaded on GitHub.
The source code of the app is in the same place.

Any feedback is appreciated :)

PS. Additional thanks to Anna Petrashko for assistant in translation of this article.

Автор: AlanDenton

Источник

* - обязательные к заполнению поля


https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js