Tyler Benfield @rtbenfield.dev · Jan 19

It makes possible this highly optimized query using ARRAY and ROW to collapse a nested relationship. Text protocol serializes that value into a string, while binary gives you all the type details for decoding the individual values correctly. I can even tell the diff between Int16 and Int32.

0 likes 1 replies

?

Replies

Tyler Benfield · Jan 19

Why write a query like that instead of a JOIN? JOINs begin to explode the result set and confuse the query optimizer once you have more than one relationship branch. This approach makes a subquery that the optimizer will construct an independent subplan for.