Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.



This page categorizes all of the relational outlines the relationship between SQL syntax clauses, relational and operational ("physical") operators in CockroachDB's SQL implementation.

It might be helpful to look at this to understand what all of the words mean in an EXPLAIN plan - and help you decode what's an efficient plan and what isn't.


SQL
Operator
Syntax clause

Logical Operator

(planNode, how it appears in EXPLAIN)

Physical Operator

(DistSQL Processor, how it appears in EXPLAIN(DISTSQL))

Notes
SELECTscanTableReader


revscanTableReader


index-joinIndexJoinerNecessary when an index being selected from doesn't contain all of the columns that the SELECT needs. Jumps back to the primary index to retrieve the other necessary data.
JOIN (inner, left/right/full outer, natural)joinHashJoinerLess efficient than merge join - has to buffer an entire side in memory.


MergeJoinerEfficient - can "stream rows" from each side.


JoinReader (lookup join)



ZigZagJoiner

subquery aka (SELECT... )subquery


DISTINCT, DISTINCT ONdistinctDistinct



OrderedDistinct

ORDER BYsortsortAllProcessor



sortTopKProcessor



sortChunksProcessor

GROUP BYaggregateorderedAggregator



hashAggregator

LIMITlimitlimit

OFFSEToffsetoffset

OVER / PARTITION BYwindowwindower