Re: [PERFORM] Repeated execution of identical subqueries

2008-03-13 Thread Craig James
Craig Ringer wrote: Tom Lane wrote: No, not at the moment. In principle the planner could look for such duplicates, but it'd be wasted cycles so much of the time that I'd be loath to do it. Good point - there are better places to spend time, and I imagine it'd be an expensive thing to check

Re: [PERFORM] Repeated execution of identical subqueries

2008-03-12 Thread Craig Ringer
Tom Lane wrote: No, not at the moment. In principle the planner could look for such duplicates, but it'd be wasted cycles so much of the time that I'd be loath to do it. Good point - there are better places to spend time, and I imagine it'd be an expensive thing to check too. There is work

Re: [PERFORM] Repeated execution of identical subqueries

2008-03-12 Thread Tom Lane
Craig Ringer <[EMAIL PROTECTED]> writes: > Is there any way to get postgresql to detect such repeated query parts > and evaluate them only once? No, not at the moment. In principle the planner could look for such duplicates, but it'd be wasted cycles so much of the time that I'd be loath to do i

[PERFORM] Repeated execution of identical subqueries

2008-03-12 Thread Craig Ringer
Hi I've been wondering about postgresql's handling of repeated subqueries in statements for a while, and thought I'd ask here. If the exact same subquery appears in multiple places in a complex query, it seems to be executed separately each time it appears. I'm wondering if there's any way,