Is it possible to execute multiple queries against the Google Spanner in on round trip?
For example, I would like to run the following two queries in one round trip: (From performance concerns)
select * from Test1;
select * from Test2;
There are couple of other things you can do to compose a single query in such a way that it contains the result of both those queries:
SELECT * FROM Test1 UNION ALL SELECT * FROM Test2
This only works if the number of columns in the two tables is same and are of the same type (or have a common supertype)
SELECT ARRAY(SELECT AS STRUCT * FROM T1), ARRAY(SELECT AS STRUCT * FROM T2)
This works even if the two tables have different number of columns or different column types. Limitation here is that this will just return a single row containing all the data which will be fully materialized in memory.