Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is a coalesce stage in Bigquery?

Want to understand what is the coalesce stage in Bigquery and in what cases this stage is seen in the plan. I didn't found information about this stage in bigquery documentation.

Note: I am not using coalesce function in the query.

Following is the screenshot for reference

like image 508
Sachin Janani Avatar asked Oct 30 '25 20:10

Sachin Janani


1 Answers

The coalesce step in the query plan is because you are querying multiple tables. This step is combining the data from each additional table you query. So, each new table, a new coalesce (and join) will be added to combine this data.

Its different than the conditional function COALESCE()


The point is, each step can directly write only one set of data to a next step. If a new set have to write, this data will be read again, that will be the coalesce step. The following chart represents what happen when 1, 2 or 3 tables a queried, and shows the join and coalesce steps. This is just an exemplification, another operations as cross are been omitted.

enter image description here

like image 52
ewertonvsilva Avatar answered Nov 03 '25 15:11

ewertonvsilva



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!