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 1pGiuE-0008Bs-4q for pgsql-performance@arkaria.postgresql.org; Sat, 14 Jan 2023 15:57:18 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pGiuB-0002xI-RA for pgsql-performance@arkaria.postgresql.org; Sat, 14 Jan 2023 15:57:15 +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 1pGiuB-0002uO-Gy for pgsql-performance@lists.postgresql.org; Sat, 14 Jan 2023 15:57:15 +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 1pGiu8-0006mk-GE for pgsql-performance@postgresql.org; Sat, 14 Jan 2023 15:57:14 +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 30EFv7rm1005544; Sat, 14 Jan 2023 10:57:07 -0500 From: Tom Lane To: "hehaochen@hotmail.com" cc: "pgsql-performance@postgresql.org" Subject: Re: change the default value of enable_bitmapscan to off In-reply-to: References: Comments: In-reply-to "hehaochen@hotmail.com" message dated "Sat, 14 Jan 2023 14:51:03 +0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1005542.1673711827.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Sat, 14 Jan 2023 10:57:07 -0500 Message-ID: <1005543.1673711827@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk "hehaochen@hotmail.com" writes: > The default is enable_bitmapscan on. However, TPC-H.query17 get slower r= unning on my NVMe SSD (WD SN850) after switching on the parameter: latency= drop from 9secs to 16secs. During a B-tree Index Scan, bitmapscan optimiz= ation converts random I/O into sequential. However, many users use SSDs ra= ther than HDDs. But they may not know the trick. Is there a possibility th= at can change the default value to off? Use ALTER SYSTEM SET, or edit postgresql.conf: https://www.postgresql.org/docs/current/config-setting.html Note that changing planner parameters on the basis of a single query getting slower is a classic beginner error. You need to think about the totality of the installation's workload. regards, tom lane