Re: Teach predtest about IS [NOT] proofs

2024-04-05 Thread James Coleman
On Mon, Apr 1, 2024 at 8:06 AM James Coleman wrote: > > On Mon, Mar 25, 2024 at 5:53 PM Tom Lane wrote: > > > > James Coleman writes: > > > [ v6 patchset ] > > > > I went ahead and committed 0001 after one more round of review > > > > statements; my bad). I also added the changes in test_predte

Re: Teach predtest about IS [NOT] proofs

2024-04-01 Thread James Coleman
On Mon, Mar 25, 2024 at 5:53 PM Tom Lane wrote: > > James Coleman writes: > > [ v6 patchset ] > > I went ahead and committed 0001 after one more round of review > > statements; my bad). I also added the changes in test_predtest.c from > 0002. I attach a rebased version of 0002, as well as 0003

Re: Teach predtest about IS [NOT] proofs

2024-04-01 Thread James Coleman
On Mon, Mar 25, 2024 at 11:45 PM Tom Lane wrote: > > I wrote: > > I went ahead and committed 0001 after one more round of review > > > > statements; my bad). I also added the changes in test_predtest.c from > > 0002. I attach a rebased version of 0002, as well as 0003 which isn't > > changed, ma

Re: Teach predtest about IS [NOT] proofs

2024-03-25 Thread Tom Lane
I wrote: > I went ahead and committed 0001 after one more round of review > > statements; my bad). I also added the changes in test_predtest.c from > 0002. I attach a rebased version of 0002, as well as 0003 which isn't > changed, mainly to keep the cfbot happy. [ squint.. ] Apparently I manag

Re: Teach predtest about IS [NOT] proofs

2024-03-25 Thread Tom Lane
James Coleman writes: > [ v6 patchset ] I went ahead and committed 0001 after one more round of review statements; my bad). I also added the changes in test_predtest.c from 0002. I attach a rebased version of 0002, as well as 0003 which isn't changed, mainly to keep the cfbot happy. I'm still

Re: Teach predtest about IS [NOT] proofs

2024-01-22 Thread Tom Lane
James Coleman writes: > 0001 does the initial pure refactor. 0003 makes a lot of modifications > to what we can prove about implication and refutation. Finally, 0003 > isn't intended to be committed, but attempts to validate more > holistically that none of the changes creates any invalid proofs >

Re: Teach predtest about IS [NOT] proofs

2024-01-17 Thread James Coleman
On Fri, Dec 22, 2023 at 2:48 PM Tom Lane wrote: > > James Coleman writes: > > I've not yet applied all of your feedback, but I wanted to get an > > initial read on your thoughts on how using switch statements ends up > > looking. Attached is a single (pure refactor) patch that converts the > > va

Re: Teach predtest about IS [NOT] proofs

2023-12-22 Thread Tom Lane
James Coleman writes: > I've not yet applied all of your feedback, but I wanted to get an > initial read on your thoughts on how using switch statements ends up > looking. Attached is a single (pure refactor) patch that converts the > various if/else levels that check things like node tag and > bo

Re: Teach predtest about IS [NOT] proofs

2023-12-22 Thread James Coleman
On Thu, Dec 14, 2023 at 4:38 PM Tom Lane wrote: > > James Coleman writes: > > On Wed, Dec 13, 2023 at 1:36 PM Tom Lane wrote: > >> I don't have an objection in principle to adding more smarts to > >> predtest.c. However, we should be wary of slowing down cases where > >> no BooleanTests are pre

Re: Teach predtest about IS [NOT] proofs

2023-12-14 Thread Tom Lane
James Coleman writes: > On Wed, Dec 13, 2023 at 1:36 PM Tom Lane wrote: >> I don't have an objection in principle to adding more smarts to >> predtest.c. However, we should be wary of slowing down cases where >> no BooleanTests are present to be optimized. I wonder if it could >> help to use a

Re: Teach predtest about IS [NOT] proofs

2023-12-13 Thread James Coleman
Thanks for taking a look! On Wed, Dec 13, 2023 at 1:36 PM Tom Lane wrote: > > James Coleman writes: > > Attached is a patch that solves that issue. It also teaches predtest about > > quite a few more cases involving BooleanTest expressions (e.g., how they > > relate to NullTest expressions). One

Re: Teach predtest about IS [NOT] proofs

2023-12-13 Thread Tom Lane
James Coleman writes: > Attached is a patch that solves that issue. It also teaches predtest about > quite a few more cases involving BooleanTest expressions (e.g., how they > relate to NullTest expressions). One thing I could imagine being an > objection is that not all of these warrant cycles in

Teach predtest about IS [NOT] proofs

2023-12-11 Thread James Coleman
Hello, I recently encountered a case where partial indexes were surprisingly not being used. The issue is that predtest doesn't understand how boolean values and IS expressions relate. For example if I have: create table foo(i int, bar boolean); create index on foo(i) where bar is true; then t