Hi Henson,

> rest.  So evaluating its DEFINE -- option (b) -- would mean running a clause
> the standard tells us to ignore.

Right.

> Agreed, and the parallel is convincing.  An unused window already escapes
> the negative-frame-offset check, so singling out DEFINE as the one clause
> that must fire regardless would be inconsistent with how the rest of an
> unused window already behaves.
> 
> This also matches the planner: select_active_windows() drops any window with
> no referencing WindowFunc, and its comment already cites the same <window
> clause> General Rules (General Rule 4) as its basis.
> 
> Either way, the disregard rule governs only execution.  A failure raised in
> the parser, transform, rewrite, or planner is a separate, static layer the
> rule does not touch.  And at execution there is nothing to evaluate: an
> unused window is never turned into a WindowAgg node, so its DEFINE is never
> reached.

Yes, the rule only applies to execution. I think what we do in other
phases is implementation dependent.

> So I'm convinced -- let's keep (a), the current behavior, and I'll treat
> this open question as closed, with no patch change.  For the record, the two
> halves stay cleanly separated: the RPR DEFINE volatility check still visits
> every window clause at preprocessing (independent of select_active_windows),
> while run-time DEFINE evaluation happens only for windows that survive it.
> 
> Thanks for digging up the standard text.

You are welcome.  Please feel free to ask me if you want to know what
9075-2 says about someting.

Regards,
--
Tatsuo Ishii
SRA OSS K.K.
English: http://www.sraoss.co.jp/index_en/
Japanese:http://www.sraoss.co.jp


Reply via email to