liveBook · Manning

Execution plan

As explained in Grokking Software Architecture

An execution plan is the database engine's strategy for executing a query, including the operations and access methods it will perform.

An execution plan makes a system’s intended work visible before you rely on it. In a database, it describes how the engine will execute a query; for infrastructure, it previews changes before they are applied. section 6.8.3 section 9.7.1

For a Terraform infrastructure plan, read the change markers before approving a deployment:

  • + means create, ~ means modify, and - means destroy. A planned deletion of a critical database is a reason to stop and investigate. section 9.7.1
Listing 9.4 Terraform Execution Plan
Terraform will perform the following actions:
 
  # aws_instance.web_server will be created
  + resource "aws_instance" "web_server" {
      + ami           = "ami-0c55b159cbfafe1f0"
      + instance_type = "t3.micro"
    }
 
  # aws_security_group.firewall will be updated in-place
  ~ resource "aws_security_group" "firewall" {
      ~ description = "Allow web traffic" -> "Allow web and API traffic"
    }
 
  # aws_db_instance.primary_db will be destroyed
  - resource "aws_db_instance" "primary_db" {
      - engine = "postgres"
    }
 
Plan: 1 to add, 1 to change, 1 to destroy.

See a sample Terraform plan that marks a server for creation, a firewall for modification, and a database for destruction. section 9.7.1

How Grokking Software Architecture covers it

How deep it goes
Defines the plan’s role and explains Terraform change markers, but does not detail database plan internals.
Examples
Shows a Terraform plan creating a server, modifying a firewall, and destroying a database.
What you can do after
Evaluate a Terraform plan by spotting create, modify, and destroy actions before deployment.
How it connects
Connects database plans to SQL, indexes, and joins, and infrastructure plans to Terraform and infrastructure as code.

Also explained in

Compare how 5 books explain execution plan →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Grokking Software Architecture. The section links point to the parts of the book it draws on.