Re: Improving non-joinable EXISTS subqueries - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: Improving non-joinable EXISTS subqueries
Date
Msg-id 20080819025722.GG4454@alvh.no-ip.org
Whole thread Raw
In response to Improving non-joinable EXISTS subqueries  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Tom Lane wrote:

> I don't think any of this is out of reach, but it'd be a nontrivial
> bit of implementation effort (maybe a week or three) and it also looks
> like there might be a measurable planning slowdown for any query
> involving subqueries.  I'm not sure yet how much of this is just moving
> existing work around and how much will actually represent new planning
> expense.  But certainly, costing EXISTS subqueries two different ways
> isn't going to be free.

The typical comment around here is that it's usually a huge win when a
bit of CPU time is spent in buying I/O savings.  Since most servers are
I/O bound anyway, and since most servers nowadays are typically
oversized in CPU terms, this strikes me as the good tradeoff to be
making.

In any case, most of the time EXISTS queries are expensive queries, so
spending more time planning them is probably good.  It'd be a shame to
spend a lot of time planning queries that are trivial in execution
costs, but I wouldn't expect this to be the case here.

-- 
Alvaro Herrera                                http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support


pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: pgbench duration option
Next
From: Simon Riggs
Date:
Subject: Design for Synchronous Replication/ WAL Streaming