Count (select 1) subquery as constant

2021-05-27 Thread Eugen Konkov
kc ON c.doc_id = o.id and c.doctype = 'OrderDetail' WHERE o.sys_period @> sys_time() AND o.app_period && app_period() ) SELECT * FROM ready -- Best regards, Eugen Konkov

Re: BUG #16968: Planner does not recognize optimization

2021-05-17 Thread Eugen Konkov
'll be able to use it in the > subquery and you'll be able to filter out the partitions that you > don't want. > I really think you're driving yourself down a difficult path by > expecting queries with whole-row vars to be optimised just as well as > using select * or explicitly listing the columns. > David -- Best regards, Eugen Konkov

Re: BUG #16968: Planner does not recognize optimization

2021-05-17 Thread Eugen Konkov
Hello David, Saturday, May 15, 2021, 5:52:47 PM, you wrote: > On Sun, 16 May 2021 at 02:34, Eugen Konkov wrote: >> I found a case when `not assigning a ressortgroupref to the whole-row var` >> cause >> wrong window function calculations. >> >> I use same qu