Manage Herbicide Imbalanced Join Conditions in Database Queries

RDBMS or Relational Database Management Systems use queries to fetch data from the database. Queries can be constructed on more than one table using equi or non equi joins. Queries can also specify where conditions, where data will be retrieved as per some conditions such as Select student_name from students where place_of_residence = “Chennai”. Join conditions are specified as Select a.customer_name, b.order_id from customer a, order b where a.customer_id = b.customer_id.In the above case a join is being made between two tables customer and order. Prior to a query being executed the SQL engine computes an execution plan. The query execution plan is a sequence of steps determined by the query optimizer. These steps would yield a sequence of operations which would result in the lowest cost of executing the query. In complex situations when queries are constructed between many tables specifying many query conditions one or two missed join conditions can lead to prolonged query run times if the database has high volumes of data.


A join of two tables without a join condition is just a cross product of two sets. If Table A has 10,000 rows and Table B has 5000 rows a cross product of two tables will result in 5,00,00,000 records. Whereas if a join condition is introduced the result set will contain 10,000 rows or 5,000 rows in the resultant search space. If a query for example contains 10 tables and cross products of two or three tables taken at a time, and if the query expression contains 20 – 30 joins 3 or 4 join conditions can be missed out due to negligence or error. This can be the case in case of SQL queries running in large manufacturing or production outlets doing heavy volume data processing. The size of each table is very large and so are the number of tables.A designer may compose a query to record an Actualization process in a production house in which actual sales data against projections are uploaded into the database. Due to the complexity of the database a single query may use 20 tables holding more than 100000 records per table on the average. The query may use a lot of joins and if due an accident some join conditions get skipped then the query would search in a space of 10 power 20 records instead of just 10 power 5 records. This would lead to prolonged query execution time sometimes a single program containing any such erroneous query can run for even 20 hours without completing the updations. But on identifying and adding missed join conditions such as table3.column3 = table4.column7 or table7.column2 = table1.column9 etc., into the query the query can be made to run in acceptable time.

Artificial Intelligence and Our Humanity

We hear and read about it everywhere these days.

You hear people saying, “The future is now.”

“We have to give way to technology.”

“We’ll be better off and live better lives (maybe not even work) if we let AI do it.”

Yes, technology is here, and we are living at the dawn of the age of AI, and it’s a topic that we’ve seen and heard a lot more about this year.

I wonder what the opportunities will be for the average person. You know, the person who is not the founder of Facebook, Google or Amazon, which have placed such high barriers to entry that it will be rare for companies to break into that stratospheric league.

What’s Going to Happen with Humans?

Do you wonder what’s going to happen to the average person? AI are taking over customer service, writing, design, sales, law, and medicine. As a businessman and social entrepreneur, the reality is that if you’re looking at things in a purely bottom-line manner, using AI could make a whole lot of sense. They never get sick. They work 27/7/365. They never stop and can indeed produce more than any human can–in a lifetime. From a pure dollars and cents perspective, AI can make a lot of sense.

But then you have to wonder about the broader implications of AI, and I sense that society has not even started to get its head around the implications. If you pay even a little attention to the news, then you know that a few months ago Facebook engineers shut down and pulled the plug on AI that decided on its own to go ahead and develop a new language. It was more efficient for them to get the work done, but humans did not understand. It seems that the language was basic, but what happens if the AI had not been shut down? Would they have developed a highly sophisticated way to communicate and operate that completely excised human?

I agree that technology can be beneficial to society. I think most people would agree that we’d prefer to send a bot into a dangerous situation, say war, rather than ask our men and women to put their lives on the line. I think there’s something to be said for the rapidly expanding role of robotics in medicine. For example, the fact that we’ve started to print human organs with 3D is a significant advancement, and we have to hope that many lives will be saved.

The Deeper Issues Related to AI

My concern as I dig deeper into the issue of AI is what the implications are for the human race, and yes, that even includes how we in the philanthropic sector connect with each other and with the world we serve. As I noted in the previous article I wrote, the Partnership on AI, which is a collaborative effort between mega-companies such as Facebook, Apple, Google and leading non-profits such as UNICEF and Human Rights are trying to lead the conversation about the implications of AI in all of our lives.

If you tune in even a little bit into the conversation about AI, you know that we have to deal with many issues, including some of the following:

Safety: We don’t want to be in a situation where AI is created, and it is not obligated to protect human life.
Transparency: We had the recent situation with Facebook where they shut down AI, but who rules (government or business) when someone says “Houston, we have a problem”?
Labor and the Economy: Whose responsibility is it to train people as AI develops and what will their work functions be in light of a much more powerful AI partner? Will people even have jobs?
Society: For communities around the world, which certainly includes nonprofit and philanthropic work, what will be the impact of AI on philanthropy, education, charitable work, science, private/public partnerships, etc.

The reality seems to be apparently developing that there are few areas–if any–that AI will not touch.

Humanity’s Competitive Advantage

When I read about issues related to AI, I think of one thing–humanity. I believe we all have to get into the conversation now about the implications of AI. I’m someone who likes and values people precisely because we are imperfect. There is a lot of prose and poetry in the human condition. AI cannot love, demonstrate courage, hope, dream, feel fear, etc.

In my mind, those qualities are what makes humans so much better than AI. Our values are our competitive advantage in comparison to AI. There is something intrinsic within people (some call it a soul or spirit, others connect the scientific dots of all the elements that make up our brains, hearts, and bodies) that makes us unique, and yes, even exceptional.

We have a serious conversation that has to take place about AI, but it involves all humans, and we have to pay attention before we have a situation we did not bargain for in the age of technology.

The Path for Humanity as it Greets AI

In many ways, I hope that AI begins to break down the things that divide us and that we discover that as humans, we are all the same. We are. Take away the issues of money, race, religion, gender and everything else; we all bleed red.

We all hurt.

We all hope.

We all dream.

The way I see it, the time is now for humanity. It can be our finest hours at the dawn of a new age–provided we all get out of our own way and engage in a global dialogue about humanity in the age of AI.