Re: [EXT] YNT: Need help tuning a query

2023-09-30 Thread Amn Ojee Uw
Wow!! This is what I call cryptic!! On 9/29/23 2:46 a.m., Vladimir Sitnikov wrote: Oh, I misplaced the added where conditions. It should have been as follows, however, the overall idea is the same --- orignial.sql +++ tuned_v2.sql @@ -83,6 +83,7 @@                                 AND

Re: [EXT] YNT: Need help tuning a query

2023-09-29 Thread Vladimir Sitnikov
Oh, I misplaced the added where conditions. It should have been as follows, however, the overall idea is the same --- orignial.sql +++ tuned_v2.sql @@ -83,6 +83,7 @@ AND (judg1.jrt_opt_out_flag <> 'Y' OR judg1.jrt_opt_out_flag IS NULL) ) sub0

Re: [EXT] YNT: Need help tuning a query

2023-09-29 Thread Vladimir Sitnikov
Steve, It looks like PostgreSQL was not able to push the join condition into group by subquery. The problematic bits in the PostgreSQL plan are -> Nested Loop Left Join (cost=3423317.32..4522882.01 rows=4 width=261) (actual time=30839.132..35117.682 rows=39 loops=1)