Re: Improving non-joinable EXISTS subqueries

From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: Improving non-joinable EXISTS subqueries
Date: 2008-08-19 02:57:22
Message-ID: 20080819025722.GG4454@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Simon Riggs 2008-08-19 03:13:40 Design for Synchronous Replication/ WAL Streaming
Previous Message Alvaro Herrera 2008-08-19 02:39:32 Re: pgbench duration option