What are the steps followed by sql engine to execute the query..??

henry picture henry · May 8, 2009 · Viewed 7.7k times · Source

My question is not how to use inner join in sql. I know about how it matches between table a and table b.

I'd like to ask how is the internal working of inner working. What algorithm it involves? What happens internally when joining multiple tables?

Answer

Lucero picture Lucero · May 8, 2009

There are different algorithms, depending on the DB server, indexes and data order (clustered PK), whether calculated values are joined or not etc.

Have a look at a query plan, which most SQL systems can create for a query, it should give you an idea what it does.