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.96) (envelope-from ) id 1vnxam-00E6HU-1s for pgsql-general@arkaria.postgresql.org; Thu, 05 Feb 2026 11:32:13 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vnxak-00GjQj-2F for pgsql-general@arkaria.postgresql.org; Thu, 05 Feb 2026 11:32:10 +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.96) (envelope-from ) id 1vnxak-00GjQW-0y for pgsql-general@lists.postgresql.org; Thu, 05 Feb 2026 11:32:10 +0000 Received: from sm-r-012-dus.org-dns.com ([84.19.1.231]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1vnxag-00000000flO-45xH for pgsql-general@lists.postgresql.org; Thu, 05 Feb 2026 11:32:09 +0000 Received: from smarthost-dus.org-dns.com (localhost [127.0.0.1]) by smarthost-dus.org-dns.com (Postfix) with ESMTP id A958AA095E for ; Thu, 5 Feb 2026 12:32:03 +0100 (CET) Received: by smarthost-dus.org-dns.com (Postfix, from userid 1001) id 9C5D2A0E62; Thu, 5 Feb 2026 12:32:03 +0100 (CET) X-Spam-Status: No, score=-0.2 required=5.0 tests=AWL,BAYES_05,DKIM_INVALID, DKIM_SIGNED,DMARC_PASS,HTML_MESSAGE,KAM_INFOUSMEBIZ,SPF_HELO_PASS, SPF_PASS autolearn=no autolearn_force=no version=4.0.1 Received: from ha01s018.org-dns.com (ha01s018.org-dns.com [62.108.32.138]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smarthost-dus.org-dns.com (Postfix) with ESMTPS id 4E4B3A095E for ; Thu, 5 Feb 2026 12:32:03 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gelassene-pferde.biz; s=default; t=1770291124; bh=1VONMb+mH/lkkuVa0XZzxpnTghVVlxPMBwQrI1AHMRI=; h=From:To:Subject; b=CM+iPOgi33g/R9RYPGD/gOCn/3tC2fk9xJqXVJsbazbnyJscGUEGBkpRHtPqoCry/ w5HHXsS1ttTA9Wp2qna8nTJtQ0/bixKR9ZUOE53y0qz9JGnXmvio85F4EGa35fb3Ws gEIl6YQQ2QjhzNGM69R4jgbQLN2k0T3qNz9cKnRs= Authentication-Results: ha01s018.org-dns.com; spf=pass (sender IP is 146.185.68.202) smtp.mailfrom=thiemo@gelassene-pferde.biz smtp.helo=dummy.faircode.eu Received-SPF: pass (ha01s018.org-dns.com: connection is authenticated) Date: Thu, 5 Feb 2026 12:32:03 +0100 From: Thiemo Kellner To: pgsql-general@lists.postgresql.org Message-ID: <3cb77721-f9a4-4600-a40a-55c69f89df25@gelassene-pferde.biz> In-Reply-To: References: <55d333e9-5172-4ece-9723-a64d6137acee@aklaver.com> Subject: Re: Top -N Query performance issue and high CPU usage MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_2_8451148.1770291123262" X-Correlation-ID: <3cb77721-f9a4-4600-a40a-55c69f89df25@gelassene-pferde.biz> X-PPP-Message-ID: <177029112391.3687536.11379375652769566234@ha01s018.org-dns.com> X-PPP-Vhost: gelassene-pferde.biz X-POWERED-BY: wint.global - AV:CLEAN SPAM:OK List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk ------=_Part_2_8451148.1770291123262 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit A nested loop is not bad per se, at least in Oracle. It depends on the data. If the number of rows participating in the join table are very unequal, the NL is the more efficient join. I would presume that every join of a fact table with a dimension table belongs to that category. ------=_Part_2_8451148.1770291123262 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit A nested loop is not bad per se, at least in Oracle. It depends on the data. If the number of rows participating in the join table are very unequal, the NL is the more efficient join. I would presume that every join of a fact table with a dimension table belongs to that category.
------=_Part_2_8451148.1770291123262--