change the default value of enable_bitmapscan to off

2023-01-14 Thread [email protected]
The default is enable_bitmapscan on. However, TPC-H.query17 get slower running 
on my NVMe SSD (WD SN850) after switching on the parameter: latency drop from 
9secs to 16secs. During a B-tree Index Scan, bitmapscan optimization converts 
random I/O into sequential. However, many users use SSDs rather than HDDs. But 
they may not know the trick. Is there a possibility that can change the default 
value to off?

Thanks!


Re: change the default value of enable_bitmapscan to off

2023-01-14 Thread Pavel Stehule
Hi


so 14. 1. 2023 v 15:51 odesílatel [email protected] <
[email protected]> napsal:

> The default is enable_bitmapscan on. However, TPC-H.query17 get slower
> running on my NVMe SSD (WD SN850) after switching on the parameter: latency
> drop from 9secs to 16secs. During a B-tree Index Scan, bitmapscan
> optimization converts random I/O into sequential. However, many users use
> SSDs rather than HDDs. But they may not know the trick. Is there a
> possibility that can change the default value to off?
>

I don't think it can be disabled by default.

When you have fast SSD disk, then common setting is decreasing
random_page_cost to some value to 2 or maybe 1.5

Regards

Pavel


>
> Thanks!
>


Re: change the default value of enable_bitmapscan to off

2023-01-14 Thread Tom Lane
"[email protected]"  writes:
> The default is enable_bitmapscan on. However, TPC-H.query17 get slower 
> running on my NVMe SSD (WD SN850) after switching on the parameter: latency 
> drop from 9secs to 16secs. During a B-tree Index Scan, bitmapscan 
> optimization converts random I/O into sequential. However, many users use 
> SSDs rather than HDDs. But they may not know the trick. Is there a 
> possibility that 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