Pipeline To Insights

Pipeline To Insights

Share this post

Pipeline To Insights
Pipeline To Insights
SQL Behind the Curtain: How Are Queries Executed?

SQL Behind the Curtain: How Are Queries Executed?

Explore the journey of your SQL query guided by execution plans

Erfan Hesami's avatar
Erfan Hesami
Nov 19, 2024
∙ Paid
38

Share this post

Pipeline To Insights
Pipeline To Insights
SQL Behind the Curtain: How Are Queries Executed?
11
Share

Imagine your SQL query is like a treasure map, and the database is a huge area to explore. The execution plan is like a detailed route created by an expert navigator (the SQL engine) to help you find the treasure (your query results) as quickly as possible. Understanding this route lets you spot shortcuts, avoid wrong turns, and reach your goal faster.

A creative and metaphorical illustration of a treasure hunt theme for SQL queries. The image depicts a vast landscape representing a database with various terrains like forests, mountains, and oceans. A detailed treasure map is laid out with a compass, marked paths, and checkpoints symbolizing an execution plan created by a navigator (representing the SQL engine). The treasure chest symbolizes query results, glowing at the endpoint of the map. The overall style is vibrant and clear, combining elements of exploration, adventure, and technical precision.
Created by GPT

By understanding SQL execution plans and the basics of Big O notation, you can optimise your queries to be faster and more effective.

In this post, we will explore how SQL Queries are executed behind the scenes.

Pipeline to Insights is a reader-supported publication. To receive new posts and support our work, consider becoming a free or paid subscriber🙂🙏.


What is Big O Notation?

Big O notation describes the performance of an algorithm in terms of how it scales with the size of the input. It provides a high-level understanding of the time or space complexity, helping us evaluate the efficiency of different operations.

From: “https://www.geeksforgeeks.org/analysis-algorithms-big-o-analysis/”

While you don’t need to be a computer scientist to write SQL, knowing the relative costs of operations helps when optimising queries.

This post is for paid subscribers

Already a paid subscriber? Sign in
© 2025 Erfan Hesami
Privacy ∙ Terms ∙ Collection notice
Start writingGet the app
Substack is the home for great culture

Share