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 1o7dRV-000517-BN for pgsql-bugs@arkaria.postgresql.org; Sat, 02 Jul 2022 13:45:49 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1o7dRR-0004Vf-T4 for pgsql-bugs@arkaria.postgresql.org; Sat, 02 Jul 2022 13:45:45 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1o7dRR-0004Lb-Kt for pgsql-bugs@lists.postgresql.org; Sat, 02 Jul 2022 13:45:45 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1o7dRH-00023w-Ps for pgsql-bugs@lists.postgresql.org; Sat, 02 Jul 2022 13:45:42 +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 262DjV01263304; Sat, 2 Jul 2022 09:45:31 -0400 From: Tom Lane To: Hung Nguyen cc: pgsql-bugs@lists.postgresql.org Subject: Re: In-reply-to: References: Comments: In-reply-to Hung Nguyen message dated "Sat, 02 Jul 2022 15:15:55 +0300" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <263302.1656769531.1@sss.pgh.pa.us> Date: Sat, 02 Jul 2022 09:45:31 -0400 Message-ID: <263303.1656769531@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hung Nguyen writes: > I'm not sure if this is really a bug, but its' super weird if the query > planner favors the trigram index over the b-tree index for joining is not > optimal to me. Thank you so much. I agree that sounds bad, but you've provided a conclusion with no supporting evidence, making it impossible to investigate. A self-contained test case that behaves this way would be ideal. Otherwise, please see https://wiki.postgresql.org/wiki/Slow_Query_Questions and provide the info suggested therein. regards, tom lane