Re: [HACKERS] <> join selectivity estimate question

2017-12-03 Thread Tom Lane
Thomas Munro writes: > So, in that plan we saw anti-join estimate 1 row but really there were > 13462. If you remove most of Q21 and keep just the anti-join between > l1 and l3, then you try removing different quals, you can see the the > problem is not the <> qual: > select count(*) > fro

Re: [HACKERS] <> join selectivity estimate question

2017-11-30 Thread Thomas Munro
On Fri, Dec 1, 2017 at 10:41 AM, Thomas Munro wrote: > On Fri, Dec 1, 2017 at 4:05 AM, Robert Haas wrote: >> Hmm, do you have an example of the better but still-funky estimates >> handy? Like an EXPLAIN plan? > > Sure. Here's some EXPLAIN ANALYZE output from scale 3 TPCH + a few > indexes[1].

Re: [HACKERS] <> join selectivity estimate question

2017-11-30 Thread Thomas Munro
On Fri, Dec 1, 2017 at 4:05 AM, Robert Haas wrote: > On Wed, Nov 29, 2017 at 11:55 PM, Thomas Munro > wrote: >> Thank you for the original pointer and the commit. Everything here >> seems to make intuitive sense and the accompanying throw-away tests >> that I posted above seem to produce sensibl

Re: [HACKERS] <> join selectivity estimate question

2017-11-30 Thread Robert Haas
On Wed, Nov 29, 2017 at 11:55 PM, Thomas Munro wrote: > Thank you for the original pointer and the commit. Everything here > seems to make intuitive sense and the accompanying throw-away tests > that I posted above seem to produce sensible results except in some > cases that we discussed, so I th

Re: [HACKERS] <> join selectivity estimate question

2017-11-29 Thread Thomas Munro
On Thu, Nov 30, 2017 at 4:08 PM, Tom Lane wrote: > Ashutosh Bapat writes: >> On Fri, Jul 21, 2017 at 4:10 AM, Thomas Munro >> wrote: >>> Please find attached a new version, and a test script I used, which >>> shows a bunch of interesting cases. I'll add this to the commitfest. > >> I added some

Re: [HACKERS] <> join selectivity estimate question

2017-11-29 Thread Tom Lane
Ashutosh Bapat writes: > On Fri, Jul 21, 2017 at 4:10 AM, Thomas Munro > wrote: >> Please find attached a new version, and a test script I used, which >> shows a bunch of interesting cases. I'll add this to the commitfest. > I added some "stable" tests to your patch taking inspiration from the

Re: [HACKERS] <> join selectivity estimate question

2017-11-29 Thread Michael Paquier
On Thu, Sep 14, 2017 at 2:23 PM, Ashutosh Bapat wrote: > Are you referring to rounding errors? We should probably add some fuzz > factor to cover the rounding errors and cause a diff when difference > in expected and reported plan rows is beyond that fuzz factor. As far as I can see the patch pro