Incorrect choice of Nested Loop for a skewed distribution

2019-09-03 Thread Oleg Kharin
Hi All, With PostgreSQL 10 and 11, the planner doesn't use the lists of most common values to determine the selectivity of "=" for Nested Loop as it does for a normal inner join in eqjoinsel_inner(). Incorrect choice of a nested loops join strategy causes poor query performance. To demonstrat

Re: UPGRADE TO PG11 CAUSED DEGREDATION IN PERFORMANCE

2019-09-03 Thread Merlin Moncure
On Sun, Aug 18, 2019 at 1:57 AM Mariel Cherkassky wrote: > > Hey, > I upgraded my pg9.6 cluster to pg11.2. > As it seems after the upgrade the duration of the same flow in my application > raised from 13 minutes to 19 minutes. > > The test I did : > 1.reset pg_stat_statements > 2.run the applicat

Re: Erratically behaving query needs optimization

2019-09-03 Thread Barbu Paul - Gheorghe
On Tue, Sep 3, 2019 at 12:57 AM Jeff Janes wrote: > > On Mon, Aug 26, 2019 at 4:26 AM Barbu Paul - Gheorghe > wrote: >> >> On Sun, Aug 25, 2019 at 5:51 PM Jeff Janes wrote: >> > >> > Yes, it certainly looks like it is due to cold caches. But you say it is >> > slow at first, and then say it v