wrong rows and cost estimation when generic plan

2022-12-06 Thread James Pang
Hi, It's a prepared sql statement on a non-partitioned table , 16millions tuples and multiple indexes on this table. pk_x primary key (aid,bid,btype) all 3 cols are bigint datatype, there is another index idx_x(starttime,endtime) , both cols are "timestamp(0) without time zone". the

Re: wrong rows and cost estimation when generic plan

2022-12-06 Thread David Rowley
On Tue, 6 Dec 2022 at 20:17, James Pang (chaolpan) wrote: > Could you provide the function name for generic plan selectivity estimation? If you look at eqsel_internal(), you'll see there are two functions that it'll call var_eq_const() for Consts and otherwise var_eq_non_const(). It'll take the