diff --git a/pgdog-postgres-types/src/array.rs b/pgdog-postgres-types/src/array.rs
index 97cefbb1f..1173dd4d7 100644
--- a/pgdog-postgres-types/src/array.rs
+++ b/pgdog-postgres-types/src/array.rs
@@ -147,6 +147,51 @@ impl Array {
         Ok(Bytes::from(result))
     }
 
+    /// Builds a 1D array in binary format
+    ///
+    /// INVARIANT: the elements are values that Postgres returned in binary for the type `element_oid`, e.g., the rows of subqueries, which we pass on to the shards as `unnest(..)` arrays.
+    /// We don't reuse `Array::encode` here, since `Array::encode` takes decoded elements, thus, we would have to decode those values first.
+    pub fn binary_from_encoded_elements<'a>(
+        element_oid: i32,
+        elements: impl ExactSizeIterator<Item = Option<&'a [u8]>> + Clone,
+    ) -> Bytes {
+        let element_count = elements.len();
+        let dimensions = if element_count > 0 { 1 } else { 0 };
+
+        let mut has_nulls = false;
+        let mut elements_len = 0;
+        for element in elements.clone() {
+            match element {
+                Some(element) => elements_len += element.len(),
+                None => has_nulls = true,
+            }
+        }
+
+        let mut buf = BytesMut::with_capacity(12 + 8 + element_count * 4 + elements_len);
+
+        buf.put_i32(dimensions);
+        buf.put_i32(i32::from(has_nulls));
+        buf.put_i32(element_oid);
+
+        if dimensions > 0 {
+            buf.put_i32(element_count as i32);
+            // Index of the first element.
+            buf.put_i32(1);
+        }
+
+        for element in elements {
+            match element {
+                Some(element) => {
+                    buf.put_i32(element.len() as i32);
+                    buf.extend_from_slice(element);
+                }
+                None => buf.put_i32(-1),
+            }
+        }
+
+        buf.freeze()
+    }
+
     fn encode_binary(&self) -> Result<Bytes, Error> {
         let mut buf = BytesMut::with_capacity(12 + 8 + self.elements.len() * 8);
         // Use ndims=0 only for truly empty arrays with default bounds.
diff --git a/pgdog/src/backend/pool/connection/mod.rs b/pgdog/src/backend/pool/connection/mod.rs
index 45130fd5b..be8b2e130 100644
--- a/pgdog/src/backend/pool/connection/mod.rs
+++ b/pgdog/src/backend/pool/connection/mod.rs
@@ -442,6 +442,20 @@ impl Connection {
         }
     }
 
+    // Replaces the Binds from `bind` (above) with the Binds of `request`.
+    // The result formats of these Binds decide how we decode rows when we merge rows across shards.
+    // E.g., `multi_step::fetch_rows` calls this, since we fetch the rows of subqueries in binary even if the client requested text.
+    pub(crate) fn set_binds(&mut self, request: &ClientRequest) {
+        let binds = request.messages.iter().filter_map(|message| match message {
+            ProtocolMessage::Bind(bind) => Some(bind),
+            _ => None,
+        });
+
+        if let Binding::MultiShard(ref mut servers) = self.binding {
+            servers.set_binds(binds);
+        }
+    }
+
     /// Execute an internal query on all connected servers.
     pub(crate) async fn execute(
         &mut self,
diff --git a/pgdog/src/backend/pool/connection/multi_shard/binding.rs b/pgdog/src/backend/pool/connection/multi_shard/binding.rs
index d0e275446..c77882a31 100644
--- a/pgdog/src/backend/pool/connection/multi_shard/binding.rs
+++ b/pgdog/src/backend/pool/connection/multi_shard/binding.rs
@@ -163,6 +163,14 @@ impl MultiBinding {
         self.state.push_bind(bind);
     }
 
+    /// See `Connection::set_binds`.
+    pub(in crate::backend::pool::connection) fn set_binds<'a>(
+        &mut self,
+        binds: impl Iterator<Item = &'a Bind>,
+    ) {
+        self.state.set_binds(binds);
+    }
+
     /// Indicates that the backend(s) have more messages for the client
     /// so it should continue to pull them from the connection (until this returns false).
     pub(in crate::backend::pool::connection) fn has_more_messages(&self) -> bool {
diff --git a/pgdog/src/backend/pool/connection/multi_shard/mod.rs b/pgdog/src/backend/pool/connection/multi_shard/mod.rs
index 0337ee7ee..cd7196888 100644
--- a/pgdog/src/backend/pool/connection/multi_shard/mod.rs
+++ b/pgdog/src/backend/pool/connection/multi_shard/mod.rs
@@ -200,6 +200,12 @@ impl MultiShard {
         self.bound_statements.push_back(bind.clone());
     }
 
+    /// See `Connection::set_binds`.
+    pub(super) fn set_binds<'a>(&mut self, binds: impl Iterator<Item = &'a Bind>) {
+        self.bound_statements.clear();
+        self.bound_statements.extend(binds.cloned());
+    }
+
     /// Who asked for each description in the request we just sent.
     fn set_describes(&mut self, describes: VecDeque<DescribedBy>) {
         self.describes = describes;
diff --git a/pgdog/src/frontend/client/query_engine/multi_step/fetch.rs b/pgdog/src/frontend/client/query_engine/multi_step/fetch.rs
index 744bf02f8..18e378faf 100644
--- a/pgdog/src/frontend/client/query_engine/multi_step/fetch.rs
+++ b/pgdog/src/frontend/client/query_engine/multi_step/fetch.rs
@@ -16,6 +16,8 @@ pub(crate) async fn fetch_rows(
     backend: &mut Connection,
     request: &ClientRequest,
 ) -> Result<(Vec<DataRow>, Option<RowDescription>), Error> {
+    backend.set_binds(request);
+
     backend
         .handle_client_request(request, &mut Router::default(), false)
         .await?;
diff --git a/pgdog/src/frontend/client/query_engine/multi_step/subquery/from_clause.rs b/pgdog/src/frontend/client/query_engine/multi_step/subquery/from_clause.rs
index bd6506118..549080241 100644
--- a/pgdog/src/frontend/client/query_engine/multi_step/subquery/from_clause.rs
+++ b/pgdog/src/frontend/client/query_engine/multi_step/subquery/from_clause.rs
@@ -6,12 +6,12 @@ use pg_raw_parse::{
     nodes::{self, Alias, RangeFunction, SelectStmt},
     transform,
 };
-use pgdog_postgres_types::{Array, Datum};
+use pgdog_postgres_types::{Array, Format};
 
 use crate::{
     frontend::client::query_engine::multi_step::SubqueryMulti,
     frontend::router::parser::rewrite::statement::insert::is_constant,
-    net::{Bind, DataRow, Decoder, RowDescription, bind::Parameter},
+    net::{Bind, DataRow, RowDescription, bind::Parameter},
 };
 
 impl<'a> SubqueryMulti<'a> {
@@ -110,9 +110,6 @@ impl<'a> SubqueryMulti<'a> {
         data_rows: &[DataRow],
         row_description: &RowDescription,
     ) -> Unique<'mem, &'mem SelectStmt> {
-        let mut decoder = Decoder::default();
-        decoder.set_row_description(row_description.clone());
-
         let base_param_len = old_bind.params_raw().len() as i32;
 
         let original_targets = match original_ast {
@@ -157,12 +154,17 @@ impl<'a> SubqueryMulti<'a> {
 
             unnest_column_names.push(mem.make_string(Some(unnest_column_name.as_str())).uncast());
 
-            let pg_catalog_type: &str = field
-                .data_type()
+            let data_type = field.data_type();
+
+            let pg_catalog_type: &str = data_type
                 .into_array_type()
                 .expect("rewrite_outer_statement_with_subquery_response checked the column types")
                 .as_pg_catalog_type();
 
+            let element_oid = data_type
+                .to_oid()
+                .expect("all data types with an array type have an OID");
+
             let node = {
                 let mut node = mem.make_node::<nodes::ParamRef>();
 
@@ -172,21 +174,19 @@ impl<'a> SubqueryMulti<'a> {
                 node
             };
 
-            let mut list_of_rows_for_col: Vec<Datum> = Vec::new();
-            for row in data_rows {
-                // TODO(jkaczman): replace all unwraps()
-                let col = row.get_column(idx, &decoder).unwrap().unwrap();
-                list_of_rows_for_col.push(col.value);
-            }
+            // We build one array for each column that the subquery returned.
+            // E.g., if SELECT id, status FROM users returns the rows (1, 'VIP'), (2, NULL) and (3, 'VIP'), we build
+            // - {1,2,3} for id
+            // - {VIP,NULL,VIP} for status
+            let elements = data_rows.iter().map(|row| {
+                row.get_raw(idx)
+                    .filter(|value| !value.is_null)
+                    .map(|value| value.data.as_ref())
+            });
 
-            let array = Array::new(list_of_rows_for_col, field.type_oid);
+            let array = Array::binary_from_encoded_elements(element_oid, elements);
 
-            // TODO(jkaczman): wonder what the performance tradeoffs are btwn. Binary and Text
-            let default_fmt = old_bind.default_param_format();
-            old_bind.push_param(
-                Parameter::new(array.encode(default_fmt).unwrap().as_ref()),
-                default_fmt,
-            );
+            old_bind.push_param(Parameter::from_bytes(array), Format::Binary);
 
             let node = mem
                 .make_type_cast(
diff --git a/pgdog/src/frontend/client/query_engine/multi_step/subquery/mod.rs b/pgdog/src/frontend/client/query_engine/multi_step/subquery/mod.rs
index 6b00973c4..27ebba953 100644
--- a/pgdog/src/frontend/client/query_engine/multi_step/subquery/mod.rs
+++ b/pgdog/src/frontend/client/query_engine/multi_step/subquery/mod.rs
@@ -32,7 +32,7 @@ use crate::{
             },
         },
     },
-    net::{Bind, DataRow, ProtocolMessage, RowDescription},
+    net::{Bind, DataRow, Format, ProtocolMessage, RowDescription},
 };
 
 /// Evaluates the Subquery and injects the results into the top-level statement.
@@ -212,6 +212,18 @@ impl<'ast> SubqueryMulti<'ast> {
                 ));
             }
 
+            // INVARIANT: the rows that subqueries return are in binary format
+            // `form_client_request` sets the result format of subqueries to binary
+            // `new_select_with_unnest` relies on this; it copies the bytes of the values into binary arrays without decoding the values
+            if let Some(row_description) = &results.1 {
+                assert!(
+                    row_description
+                        .fields
+                        .iter()
+                        .all(|field| field.format() == Format::Binary),
+                );
+            }
+
             self.subquery_results.push(results);
         }
 
diff --git a/pgdog/src/frontend/client/query_engine/multi_step/subquery/request.rs b/pgdog/src/frontend/client/query_engine/multi_step/subquery/request.rs
index 04cf146c7..6f2bd082c 100644
--- a/pgdog/src/frontend/client/query_engine/multi_step/subquery/request.rs
+++ b/pgdog/src/frontend/client/query_engine/multi_step/subquery/request.rs
@@ -29,7 +29,7 @@ impl<'a> SubqueryMulti<'a> {
         is_subquery: bool,
     ) -> Result<Option<(Vec<DataRow>, Option<RowDescription>)>, Error> {
         let mut client_request: ClientRequest = self
-            .form_client_request(engine, query_string, context)
+            .form_client_request(engine, query_string, context, is_subquery)
             .await?;
 
         multi_step::update::route(engine, &mut client_request, context)?;
@@ -133,9 +133,16 @@ impl<'a> SubqueryMulti<'a> {
         engine: &mut QueryEngine,
         mut query_string: String,
         context: &mut QueryEngineContext<'_>,
+        is_subquery: bool,
     ) -> Result<ClientRequest, Error> {
         let mut client_request = {
             let mut bind = Bind::default();
+
+            if is_subquery {
+                // We fetch the rows in binary, which allows us to copy the values into the unnest(..) arrays of the outer statement as-is (instead of decoding the values).
+                bind.set_binary_results();
+            }
+
             let mut actual_param_index = 1;
             let mut actual_param_index_str = format!("${actual_param_index}");
 
diff --git a/pgdog/src/frontend/router/parser/rewrite/statement/insert.rs b/pgdog/src/frontend/router/parser/rewrite/statement/insert.rs
index 8dcdb2097..d6b71eec9 100644
--- a/pgdog/src/frontend/router/parser/rewrite/statement/insert.rs
+++ b/pgdog/src/frontend/router/parser/rewrite/statement/insert.rs
@@ -133,15 +133,19 @@ impl UnnestInsert {
 
         let single_row_requests = (0..row_count)
             .map(|row_index| {
+                // These requests are only for routing (we never send them).
+                // Bit of a workaround used here: we encode the elements as text, as the router can't read binary elements of a different type than the sharding key column
+                // E.g., in INSERT INTO orders (id, user_id) SELECT sum(id), sum(user_id) FROM orders, sum(user_id) is a numeric and the sharding key user_id is a bigint
+                // TODO(jkaczman): Give the router this capability
                 let mut single_row_bind = Bind::new_statement("");
                 for unnest_array in &unnest_arrays {
                     let element_param = match unnest_array.elements.get(row_index) {
                         Some(element) if !element.is_null() => {
-                            Parameter::new(&element.encode(unnest_array.format)?)
+                            Parameter::new(&element.encode(Format::Text)?)
                         }
                         _ => Parameter::new_null(),
                     };
-                    single_row_bind.push_param(element_param, unnest_array.format);
+                    single_row_bind.push_param(element_param, Format::Text);
                 }
 
                 Ok(ClientRequest {
diff --git a/pgdog/src/net/messages/bind.rs b/pgdog/src/net/messages/bind.rs
index cf72dfa11..c6652dcd0 100644
--- a/pgdog/src/net/messages/bind.rs
+++ b/pgdog/src/net/messages/bind.rs
@@ -55,6 +55,14 @@ impl Parameter {
             data: Bytes::copy_from_slice(data),
         }
     }
+
+    // Takes `data` without copying the bytes.
+    pub(crate) fn from_bytes(data: Bytes) -> Self {
+        Self {
+            len: data.len() as i32,
+            data,
+        }
+    }
 }
 
 /// Parameter with encoded format.
@@ -264,6 +272,13 @@ impl Bind {
         me
     }
 
+    pub(crate) fn set_binary_results(&mut self) {
+        const BINARY_FOR_ALL_COLUMNS: &[u8] = &1i16.to_be_bytes();
+
+        self.results = Bytes::from_static(BINARY_FOR_ALL_COLUMNS);
+        self.original = None;
+    }
+
     pub(crate) fn set_param(&mut self, index: usize, param: Parameter) -> Option<()> {
         *self.params.get_mut(index)? = param;
         self.original = None;
