Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1psOlO-00023w-NS for pgsql-performance@arkaria.postgresql.org; Fri, 28 Apr 2023 14:07:54 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1psOlN-0000Nk-Kv for pgsql-performance@arkaria.postgresql.org; Fri, 28 Apr 2023 14:07:53 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1psOlN-0000Mk-AT for pgsql-performance@lists.postgresql.org; Fri, 28 Apr 2023 14:07:53 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1psOlK-002Mq5-OM for pgsql-performance@lists.postgresql.org; Fri, 28 Apr 2023 14:07:52 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 33SE7lpO1339837; Fri, 28 Apr 2023 10:07:47 -0400 From: Tom Lane To: =?UTF-8?B?zqDOsc+BzrHPg866zrXPhc63IM6gzrHPg8+DzrHPgc63?= cc: pgsql-performance@lists.postgresql.org Subject: Re: Performance issues in query with multiple joins In-reply-to: References: Comments: In-reply-to =?UTF-8?B?zqDOsc+BzrHPg866zrXPhc63IM6gzrHPg8+DzrHPgc63?= message dated "Fri, 28 Apr 2023 15:19:21 +0300" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1339835.1682690867.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Fri, 28 Apr 2023 10:07:47 -0400 Message-ID: <1339836.1682690867@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk =3D?UTF-8?B?zqDOsc+BzrHPg866zrXPhc63IM6gzrHPg8+DzrHPgc63?=3D writes: > We are facing a performance issue with the following query. Executing th= is > query takes about 20 seconds. Raising join_collapse_limit (to more than the number of joins in the query) might help. But I think really if performance is a problem you should think about ditching the star schema design. regards, tom lane