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 1tpjLm-00B7P4-BW for pgsql-general@arkaria.postgresql.org; Wed, 05 Mar 2025 07:39:30 +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 1tpjLk-003kSt-7P for pgsql-general@arkaria.postgresql.org; Wed, 05 Mar 2025 07:39:28 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tpjLj-003kSa-RU for pgsql-general@lists.postgresql.org; Wed, 05 Mar 2025 07:39:27 +0000 Received: from mail-wr1-x429.google.com ([2a00:1450:4864:20::429]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1tpjLg-0013WD-0T for pgsql-general@lists.postgresql.org; Wed, 05 Mar 2025 07:39:27 +0000 Received: by mail-wr1-x429.google.com with SMTP id ffacd0b85a97d-38f2f391864so3568827f8f.3 for ; Tue, 04 Mar 2025 23:39:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cybertec.at; s=google; t=1741160364; x=1741765164; 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=Vfdn3Sf6CokQYZsb3Lq5GPlcC/yk0I4HCYRzUpWiHlo=; b=ikCSUtt3kuGaPy/2Emg5oLsF8clJuQByADaSYjdslf8xrAqJpF5ThfrxeW4Cz9Ws7Y zbwa+XR408Guh30yGoyORCtKnmZ0Juil+q46tfoBZ0G2htcIZQDwKcNfZwdR+gJaK0oh WHCFwHD+aK+bfKUlzqjJVtsuWDgxZagpRRliJLGRsHU0Es1QBZ/EkzTLXVhQpoVN3y7p P6xg2rb0EkVMXV6TtpQ30mruOn6j3XN7CQ5WKo3AN+xrCMCeycxpH6BWysiMetHmQLTn J9tH7PBd17Zkv+H02UxjX85arrCj/k/urH3NaL2M0/NeH/D2xk4tTH1jYxiYLt3UfrAb 3maQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741160364; x=1741765164; 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=Vfdn3Sf6CokQYZsb3Lq5GPlcC/yk0I4HCYRzUpWiHlo=; b=rm+Rc2JjgMnQYqPOmRWicADAW0QG5IGUwzY/ZXM5zc3fqLDoeRWayLL1jH/NdTFf0L MdqDkPRlsduD47YAOaMxIyyZEpmPW873adL9WSdR9hn7o2D99O2EqevLvClCQ1Mg9Xt1 8Z2P1UYXipYq5WtiFVy3E0HoxKG+TCde3jctSNAwtvq4oooGYKkdQa1x5ONo4iEoS1gs KA7FkShw95tQyBuvFvaj0YaCmN6M+A0gO8MwtDgAHKUwpOGlttiYnuBbIZ2XN38Q1m7J vjxpnIAIkSX+rBFzzQU+/bmBRwBVaOeo+ntyNBDaPd2yi/aVWlaRitlFN+NO2d7jXUKV 4qrA== X-Gm-Message-State: AOJu0YwZlLO7nZGyFA3HsBShIrWRX9yclpfd5OsulhprZ1a0CEtJKzZf BQ2rzotJgfIPM+lETwJ6i1nyBDPKoRh2IMRgOyKSFsrJM1U2WrPYF1S75nPheyo= X-Gm-Gg: ASbGncvhLKhIQe7Q9VGccn0wfzav2s7cHWTvvojCRrKEcy92WEDAhC1OogLaBIRzvL3 wyb4uMdnBEY24TWK+2/M5ncd8D+EgNeeG1ERjJO6wgLZGBkchA43JJP0zP3FJNIBZg/ywC/j3EC iwWInvd3v7AuKXBvkc9BZeYznwsQ98RWClRcLhtsecQQfyP/Ew9iJoGmlGOXDE73LnjBwhnp8Ru oycUYx/q06MZvaeroxA5AISm7gC/7gAc2vbUfaoQznCUqNn2uIa5l5YkVK+GM1lWtq+k5uwF8rq AXTrFBXOSxGAdCwCxFU4IUWLWBfeqfIUAsvnqGGXMEu5UZC88rT2D/MRVH3B3A== X-Google-Smtp-Source: AGHT+IFZrXBdmnwgXpHaGxorYL37lgCSYn94XDCs+w20LbYBM5l86jfIKnjSeZuhVsgIUoWy/gC8JA== X-Received: by 2002:a5d:64a9:0:b0:38f:2678:d790 with SMTP id ffacd0b85a97d-3911f770a3amr1170114f8f.33.1741160364085; Tue, 04 Mar 2025 23:39:24 -0800 (PST) Received: from localhost.localdomain ([41.66.99.126]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-39122da6cb4sm922636f8f.72.2025.03.04.23.39.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Mar 2025 23:39:23 -0800 (PST) Message-ID: Subject: Re: Quesion about querying distributed databases From: Laurenz Albe To: me nefcanto , Adrian Klaver Cc: pgsql-general@lists.postgresql.org Date: Wed, 05 Mar 2025 08:39:21 +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 10:12 +0330, me nefcanto wrote: > Adrian Klaver, thank you for the link. I asked the AI to create a query f= or me using FDW. >=20 > The problem here is that it collects all of the product_id values from th= e ItemCategories table [...] >=20 > That's not scalable. Is there a workaround for this? Without having scrutinized the case in detail: if your data are organized i= n an entity-attribute-value design and distributed across three databases, you c= annot expect to end up with efficient queries. Perhaps you can extract the data and load them into a reasonably organized single database. Such an ETL process might make the task much easier. Yours, Laurenz Albe