Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tplT2-00BiNh-4n for pgsql-general@arkaria.postgresql.org; Wed, 05 Mar 2025 09:55:08 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1tplT0-006YRN-DW for pgsql-general@arkaria.postgresql.org; Wed, 05 Mar 2025 09:55:06 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tplT0-006YRE-0i for pgsql-general@lists.postgresql.org; Wed, 05 Mar 2025 09:55:06 +0000 Received: from mail-ed1-x52c.google.com ([2a00:1450:4864:20::52c]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1tplSy-0015F4-0g for pgsql-general@lists.postgresql.org; Wed, 05 Mar 2025 09:55:05 +0000 Received: by mail-ed1-x52c.google.com with SMTP id 4fb4d7f45d1cf-5e0573a84fcso8896298a12.2 for ; Wed, 05 Mar 2025 01:55:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cybertec.at; s=google; t=1741168502; x=1741773302; darn=lists.postgresql.org; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:from:to:cc:subject :date:message-id:reply-to; bh=pMg+tLgsDCYacC/Y9cwI1zFZTc4vVZ1bIyvOQJ+Nxuo=; b=Wg61/IxYkc4crjXZmh9IghNHe6vyuRUqI3mk1YpDgh+p0Die7+BX1fGRXKKCSsjRJq ZQ/N8NFmczpM1NGfsOTRxV53g0Gtu+sBLo7Ann1JBPjWrsw0OV0CQ0Jj6GPm4Nwv8Egt WCtGkygvuQHNfQPEkwYbzu1dJ0xoA8x89RCjJF1e97bX1+t3CMYnyXplL+7pTQT2Y5HV 0zATHKYj+tv5A9lQiqXa789CWTuFca1wZQf4DldcRb2SoUTkKiMdNgeV3cpT9K5KErhj +/Cu0lzjBfwLXxmoIS4+rLIAQhztoRwLO9gq9qsONIZ7s669qQHcfnBR7u3rzxowV5lb PioQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741168502; x=1741773302; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=pMg+tLgsDCYacC/Y9cwI1zFZTc4vVZ1bIyvOQJ+Nxuo=; b=iuicIbKrz64ZMf5xiU8VRlVRYYCjjP2B/9TdXo5tpkBzFNB/P9/DC9ZQ2sG1n0WNrp GxfOu7SHeUvF5q4r8d91jd0BqmaKwvCkyg4ubnbtisVCEg6DFKQpkANH2igNrde7VvAq Cy24WBD8Dg3rO14i5y6BZNktlsKItUWWZf+NQPsUY3DBe6h4fjJR0hD4RIREXL5VRpXK dVTFS/6oF2R6m3rvTylZ2DRjqROSc01AVVKkpNyy+0K8IFglIlzU8pHEmpQkqzh2V/F4 RNYM11UJo7yRx0CPPA6/uCns74ffXPiz9rWx5UB3gIs1ryhueo1CMxuAZOt7hxlyWBJh yc2w== X-Forwarded-Encrypted: i=1; AJvYcCUbKnOKi8CyYvrzYFsF0R3unldZgJGCd9NHP8DmwlT5OYq9aTwDCwQ7uJaZslIthPK5TIet6SE7xqirkt2R@lists.postgresql.org X-Gm-Message-State: AOJu0YxE6P4F5P0Igxu/6IBVDFN0q/S5wJ9rR8Ec+weSrkUNLt/k1J47 Nvp7aQ2ejA+gTktHelmZirTq9g0RgJL3BazIw5khc5Q22WYBF2Bi2wwMmbnwjaC4OzpxFqzLCKj I6xM= X-Gm-Gg: ASbGnctN+piNQYeij4D9Td4pCv+QBzXWG7SUkDR8GWpXsnDIcweTvb9A3q/grmP1Jg1 PQEPbZu5/IyxrGFxq4rudR6TcQ+F8gjOiHuZ6oMxj+JA0BCIClSIMR5Tl1knFJBwLDq4T0Pb97e KoE1JkGLY5p7B1ul6bvj2POPYrpmya8FZBPCLHn2vDqKS9fqAXZJalHgNMn3L5ILY/rTnJWhHTj jlR22OE0dBAnjdeZFOLo5CA3mKWUEiwy6z0h8A/cnclIqjwUqLYNk67La9eTMpZr+dw1NZ072D0 volQQqN/1klENjSbAZpQtySxH7VT2jrrvm+BR3+NvRvOGacbuG+kgc1X7ESDWYZI X-Google-Smtp-Source: AGHT+IHYlnBKRLaHYM7TY47oLKVVlpziWS40znvAAROabZRypliaxGp2wNO/sOxwJjchWwA88KWPCw== X-Received: by 2002:a05:6402:1ece:b0:5e4:d75a:573e with SMTP id 4fb4d7f45d1cf-5e59f4f8e28mr2229899a12.32.1741168501911; Wed, 05 Mar 2025 01:55:01 -0800 (PST) Received: from localhost.localdomain ([88.116.133.170]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5e533a89a21sm5591048a12.60.2025.03.05.01.55.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Mar 2025 01:55:01 -0800 (PST) Message-ID: Subject: Re: Quesion about querying distributed databases From: Laurenz Albe To: me nefcanto Cc: Adrian Klaver , pgsql-general@lists.postgresql.org Date: Wed, 05 Mar 2025 10:55:01 +0100 In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.54.3 (3.54.3-1.fc41) MIME-Version: 1.0 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Wed, 2025-03-05 at 12:57 +0330, me nefcanto wrote: > Right now this data is in MariaDB, on separate databases (schema) but on = one > server. The solution in this situation is to have a cross-database query. > (this is the status quo of our application) >=20 > Now our team has decided to migrate to Postgres. However, we realized tha= t > Postgres does not support cross-database queries. And if we want to do so= , > we should use FDW. So, we thought we might as well put databases on separ= ate > servers for scalability if we have to write more code. That's the reason > behind this question. In MySQL, the terms "database" and "schema" are used for the same thing. Not so in PostgreSQL. I think you should migrate the data into different schemas in a single database, pretty much like you had it in MySQL. Then you don't need a foreign data wrapper, and I bet the query can perform as well as it did on MySQL. Yours, Laurenz Albe