Study Vault Search notes, aliases and full text
Graph
ConceptDBISProofread

Query Plan

A query plan is a sequence of table operations (equivalently a nested expression or a tree) that computes the result of a SQL query; its estimated cost is the sum of the estimated costs of its operations.

Join Graph#

Given nn tables, compute the adjaciency lists as follows:

  • If T1T_1 can be joined with T2T_2, add T2T_2 to the adjecency list of T1T_1

Cost function#

  • size(A⋈B)=min{size(A),size(B)}size(A \bowtie B) = min\{size(A), size(B)\}
  • cost(A⋈B)=cost(A)+Cost(B)+size(A⋈B)cost(A \bowtie B) = cost(A) + Cost(B) + size(A\bowtie B)

Optimal Cost#

Given a set of operatins S={A,B,...,C}S=\{A,B,...,C\} Then find the minimum over all partitions S1,S2S_1, S_2 where S1∪S2=S∧S1∩S2=∅∧∣S1∣>0∧∣S2∣>0S_1 \cup S_2 =S \land S_1 \cap S_2 = \emptyset \land |S_1| > 0 \land |S_2| >0

cost∗(S)=min⁡{cost∗(S1)+cost(S2)+cost∗(S1⋈S2)}cost*(S) = \min\{ cost*(S_1) + cost(S_2) + cost*(S_1 \bowtie S_2)\}

This is a recursive formular, that can be computed efficently using dynamic programming.

Search

Type In
↑ ↓ move ↵ open ⇥ next section Ctrl↵ results page Prefix # to search text only