When a CockroachDB node receives a SQL query, this is approximately what happens: The pgwire module handles the communication with the client application, and receives the query from the client.