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 1tpnEk-00CCjz-7j for pgsql-general@arkaria.postgresql.org; Wed, 05 Mar 2025 11:48: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 1tpnEi-008sYO-Ha for pgsql-general@arkaria.postgresql.org; Wed, 05 Mar 2025 11:48:28 +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 1tpnEi-008sYG-5R for pgsql-general@lists.postgresql.org; Wed, 05 Mar 2025 11:48:28 +0000 Received: from mail-ed1-x530.google.com ([2a00:1450:4864:20::530]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1tpnEg-001690-0r for pgsql-general@lists.postgresql.org; Wed, 05 Mar 2025 11:48:27 +0000 Received: by mail-ed1-x530.google.com with SMTP id 4fb4d7f45d1cf-5e4ad1d67bdso10653633a12.2 for ; Wed, 05 Mar 2025 03:48:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cybertec.at; s=google; t=1741175305; x=1741780105; 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=9EbyIAcTNU/nziDS4H8gc4uii8GRCUfTMam1pS62J3U=; b=CvyEsoT9snqi03ZNpctAgWbu4NWx/5AT1STTzEAmLJyKFhWIFeizgEBt268l1R5ba6 to5oGRSEqOAdNNUwOXDiQ/C/DW7OAtqVKxbcenoTRnp13LHTVPjWScR+GdcaKtoiKdTS TfJJtO7PGSplIJqhuFmSnZb5igsl5132EW/DuKYZdshzWHQlZ/tQLKa5hBD1jvXune7u Cz9xiiHpIpe6GWgZoEDV5aJ0iORDgT0WDpR5+r9sxVWGWGPFc3RmI1Tp3gyUSn/un/l5 InkuxbWPFW7yJ2Bu7IWdfEZnY2nAGC+L1vYmMZXYXB0oHcF5Cd01b9V2iLOD8P5eOsoa zypw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741175305; x=1741780105; 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=9EbyIAcTNU/nziDS4H8gc4uii8GRCUfTMam1pS62J3U=; b=VRZb4pQqVToxMBBJnrtJke5fqjjquhm7WAjSImnn/zbYOiexEThQUql4nl7TWST+6p wJwhW0jniSWZbSeDYEWbWeP6NKJYMNqpyBGw0MXGtQShAgiYRRWC/Y1oXcbqe6Su0Ha7 PEtpol3baoXruTYVKz9j7LVcllVVcHWeXW3/K6WgO/r8BoXYdiWsELMawd2ZSmNtLOBP iwf5OrTFO/zsMwijMe9mfNY/+AaoyWFyo8kuyckolhuayjS+GF+6cWPxeYGEG6xDrMAb bEqtPFCyHpYSJ0IiTBvbAKUZQ1usOHRP8DICOOk46yiQ+G5Zu9EgLOqr2s/5kJgf3tH5 SM0Q== X-Forwarded-Encrypted: i=1; AJvYcCUWzbIfWLCXL+lZKq7KWVtwPCh0FHC6Uhs1tPVqh5XIwaWCMTb59INjxyjceA/pt1HakHqQUN1eUKon3Rt8@lists.postgresql.org X-Gm-Message-State: AOJu0Yzi3VpmwBeLtDh0jy8Bk2TP/7M1yxQyuhLWTiyKIGU7Qk2VZu/t mqha7jRwawYfTh/EQxYvXQQjQyI621/I12YvPOJwIsyJUwW9hu6DYSgkP6iMD7s= X-Gm-Gg: ASbGncso71OypvMq9JOxi1Bf/aqq/vJCWiQLmttN7ewC72qU6VYYGUCtuEOlTAUwcG3 a0toxeo6UVF5Rd3pcNgAZ8WSTXmWqMUfDwNGNL9ohOqG0s6vqiWyzPeiQwevtIUrpIUf0HWNL3T QwGv/5EwYOyMdCtRNKXdmgISCaid5hJkkto8QURpdfXO6Vp/mGMu1SimNULfxsYjCir8iDZD6eI ZYnNJBSQSENCO6+JPs+vIRybsBhMXphV6R69KwTIYfKSR9eg+BbSNTo88WKIBcvtBXteGd5DXtx jzHB0FvTQEzt734VO9Buj9ICfoNFhVbDWHj5M+fMVZhbFi56OPjgPWXaJnqQZ1Tz X-Google-Smtp-Source: AGHT+IEt3TARUI81GkBf0xeQ7KwKNgdEg9BJ+ksVcf/DW4ZqvL6l+hS93k5cS4jOO+lLU884Kh708g== X-Received: by 2002:a17:907:9692:b0:abf:6166:d0c9 with SMTP id a640c23a62f3a-ac20d852cdfmr263371866b.2.1741175304749; Wed, 05 Mar 2025 03:48:24 -0800 (PST) Received: from localhost.localdomain ([88.116.133.170]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-ac1efd7d3dfsm291989666b.166.2025.03.05.03.48.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Mar 2025 03:48:24 -0800 (PST) Message-ID: <099b49ebae94e23f19afdad3f8c9c6e702a3a2d5.camel@cybertec.at> 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 12:48:23 +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 14:18 +0330, me nefcanto wrote: > That means a solid monolith database. We lose many goodies with that. > As a real-world example, right now we can import a single database > from the production to the development to test and troubleshoot data. Well, can't you import a single schema then? > What if we host all databases on the same server and use FDW. What > happens in that case? Does it return 100 thousand records and join > in the memory? It will do just the same thing. The performance could be better because of the reduced latency. > Because in SQL Server, when you perform a cross-database query > (not cross-server) the performance is extremely good, proving that > it does not return 100 thousand ItemId from Taxonomy.ItemCategories > to join with ProductId. >=20 > Is that the same case with Postgres too, If databases are located > on one server? No, you cannot perform cross-database queries without a foreign data wrapper. I don't see a reason why the statement shouldn't perform as well as in SQL Server if you use schemas instead of databases. Yours, Laurenz Albe