Re: BUG #18344: Pruning tables partitioned by bool range fails with invalid strategy
От | David Rowley |
---|---|
Тема | Re: BUG #18344: Pruning tables partitioned by bool range fails with invalid strategy |
Дата | |
Msg-id | CAApHDvqdnpebVXsxT4BouGFHkCX+4pupr+rxckgkxRprj+kzow@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: BUG #18344: Pruning tables partitioned by bool range fails with invalid strategy (Tom Lane <tgl@sss.pgh.pa.us>) |
Список | pgsql-bugs |
On Fri, 16 Feb 2024 at 05:28, Tom Lane <tgl@sss.pgh.pa.us> wrote: > What seems to be happening is that gen_prune_step_op is getting > op_is_ne = true and doing this: > > /* > * For clauses that contain an <> operator, set opstrategy to > * InvalidStrategy to signal get_matching_list_bounds to do the right > * thing. > */ > opstep->opstrategy = op_is_ne ? InvalidStrategy : opstrategy; > > but then we're failing in get_matching_range_bounds, ie somebody > taught get_matching_list_bounds to do the right thing but not > any of the other code paths. hmm, yeah. I'm just trying to wrap my head around if this can even work for RANGE partitioned tables. > I'm also wondering how we got there in the first place. It looks like > match_boolean_partition_clause thinks it can translate "b IS NOT true" > to "b <> true", which is flat wrong --- it gives the wrong result for > null. Thought I'd fixed that in e0693faf7, but looks like I only tested it with DEFAULT partitions, not NULL partitions. A fairly simple fix for that part: /* Always include the default partition if any. */ result->scan_default = partition_bound_has_default(boundinfo); + /* Likewise for the NULL partition, if any */ + result->scan_null = partition_bound_accepts_nulls(boundinfo); I'll look at the RANGE <> bool stuff. David
В списке pgsql-bugs по дате отправления: