Skip site navigation (1) Skip section navigation (2)

Re: Repeated execution of identical subqueries

From: Craig Ringer <craig(at)postnewspapers(dot)com(dot)au>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: Repeated execution of identical subqueries
Date: 2008-03-13 06:35:00
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-performance
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 afoot to implement the SQL:2003 "WITH" syntax, which
> I think would offer a syntactic solution to your problem.
Yes, it would. In fact, I was thinking about the syntax seen in some 
functional languages - like Haskell's `where' clause - that defines a 
subexpression available to all parts of the expression. If the SQL:2003 
WITH expression is anything like that it'd be very handy indeed.

Craig Ringer

In response to


pgsql-performance by date

Next:From: petchimuthu lingamDate: 2008-03-13 07:21:54
Subject: partial index + select query performance
Previous:From: Joshua D. DrakeDate: 2008-03-13 05:55:54
Subject: Re: Benchmark: Dell/Perc 6, 8 disk RAID 10

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group