Re: Slow query and wrong row estimates for CTE

2021-02-17 Thread Yoan SULTAN
*You are totally right, the max(score_value) FILTER (WHERE score_name = 'student_performance_index') in the SELECT clause is redundant.* Le mer. 17 févr. 2021 à 21:33, Dane Foster a écrit : > On Wed, Feb 17, 2021 at 1:37 PM Yoan SULTAN wrote: > >> *Hi all, * >> >> *This is my first post on th

Re: Slow query and wrong row estimates for CTE

2021-02-17 Thread Dane Foster
On Wed, Feb 17, 2021 at 1:37 PM Yoan SULTAN wrote: > *Hi all, * > > *This is my first post on this mailing list, I really enjoy it.* > *I wanted to add some details and answers to this disccusion.* > I'm happy you've decided to join the conversation and about the fact that you've opened up an ent

Re: Slow query and wrong row estimates for CTE

2021-02-17 Thread Yoan SULTAN
*Hi all, * *This is my first post on this mailing list, I really enjoy it.* *I wanted to add some details and answers to this disccusion.* 17 févr. 2021 à 17:52, Dane Foster a écrit : > > A small update (see below/inline). > > > On Tue, Feb 16, 2021 at 2:11 PM Dane Foster wrote: > >> Short co

Re: Slow query and wrong row estimates for CTE

2021-02-17 Thread Dane Foster
A small update (see below/inline). On Tue, Feb 16, 2021 at 2:11 PM Dane Foster wrote: > Short conclusion: > Switching from CTEs to temporary tables and analyzing reduced the runtime > from 15 minutes to about 1.5 minutes. > > > Longer conclusion: > > @Justin Pryzby > >- I experimented w/ m